달력

2

« 2025/2 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
2016. 2. 7. 23:36

다운 프로그래밍/자료구조설계2016. 2. 7. 23:36

'프로그래밍 > 자료구조설계' 카테고리의 다른 글

인터넷 check sum 함수의 구현  (0) 2016.02.08
void*  (0) 2015.10.23
열거형 enum  (1) 2015.10.23
윈도우에서 리눅스처럼 컴파일하기  (1) 2015.09.19
:
Posted by youjin.A
2016. 2. 7. 23:17

프로세싱 아두이노/프로세싱2016. 2. 7. 23:17


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const int ledPin = 9;      // the pin that the LED is attached to
 
void setup()
{
   // initialize the serial communication:
   Serial.begin(9600);
   // initialize the ledPin as an output:
   pinMode(ledPin, OUTPUT);
}
 
void loop() {
   byte brightness;
 
   // check if data has been sent from the computer:
   if (Serial.available()) {
     // read the most recent byte (which will be from 0 to 255):
     brightness = Serial.read();
     // set the brightness of the LED:
     analogWrite(ledPin, brightness);
   }
}

 

 



3. 프로세싱!!

프로세싱에 아래의 코드를 넣는다

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import processing.serial.*;
  Serial port;
  
  void setup() {
  size(256, 150);
  
  println("Available serial ports:");
  println(Serial.list());
  
  // Uses the first port in this list (number 0).  Change this to
  // select the port corresponding to your Arduino board.  The last
  // parameter (e.g. 9600) is the speed of the communication.  It
  // has to correspond to the value passed to Serial.begin() in your
  // Arduino sketch.
  port = new Serial(this, Serial.list()[0], 9600);  
  
  // If you know the name of the port used by the Arduino board, you
  // can specify it directly like this.
  //port = new Serial(this, "COM1", 9600);
  }
  
  void draw() {
  // draw a gradient from black to white
  for (int i = 0; i < 256; i++) {
  stroke(i);
  line(i, 0, i, 150);
  }
  
  // write the current X-position of the mouse to the serial port as
  // a single byte
  port.write(mouseX);
  }



:
Posted by youjin.A

와.. 어언 3개월 전 여름 방학때 라즈베리파이를 만지면서

어? 특수문자 입력이 이상하다 하다가 |(OR)가 안되는것 발견..

아무리 해도 안되.. 코드를 짜야되는데.. 포기포기 하다가..

3개월뒤 오늘 아주 쉽게 해결!!

 

커맨드라인에다가 아래와 같이 적고 키보드 설정에 들어간다.

#sudo nano /etc/default/keyboard

키보드 설정에 들어가면 기본 설정이 gb(아마도 Great Britain)인듯 인데 이걸 us로 바꺼준당!!ㅎㅎ

저장하고 재부팅하면 끄읏..

그러면 키보드 그대로~ 잘나옴.


# 라즈베리파이 잔여공간 확보

1. 터미널-> sudo raspi-config ->expand filesystem -> 자동재시작

2. 터미널-> df -h : 여유공간 확인(Avail의 총합이 사용가능공간임) 

 

'라즈베리파이 > 기본' 카테고리의 다른 글

라즈베리 파이 i2c 통신 하기!  (0) 2016.02.07
자동 로그인, 자동 프로그램 돌리기  (0) 2016.02.07
라즈비안 OS 설치  (0) 2016.02.07
:
Posted by youjin.A