블로그 이미지
Leeway is... the freedom that someone has to take the action they want to or to change their plans.
maetel

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

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
  • total
  • today
  • yesterday

Category

2006. 12. 10. 17:23 Hardware

processing

// Serial Output + debug
int ledPin = 48;

int switchpin = 0;  // switch connected to pin 0
 
void setup() {
  pinMode(switchpin, INPUT);  // pin 0 as INPUT
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);         // start serial communication at 9600bps

}
 
void loop() {
  digitalWrite(ledPin, HIGH);
  Serial.print(1);                  // send 1 to Processing
  delay(500);

  digitalWrite(ledPin, LOW);
  Serial.print(0);                  // otherwise send 0 to Processing
  delay(300);
/*  delay(200);
  digitalWrite(ledPin, LOW);
  delay(200);
  if(digitalRead(switchpin) == HIGH)  // if switch is ON
  {
    digitalWrite(ledPin, HIGH);
        Serial.print(1);                  // send 1 to Processing
  }else{
    digitalWrite(ledPin, LOW);
    Serial.print(0);                  // otherwise send 0 to Processing
  }
  delay(100);                         // wait 100ms
  */
}

'Hardware' 카테고리의 다른 글

smd toast oven  (0) 2008.03.24
Wiring board + 가속도 센서 시리얼 통신 테스트  (0) 2007.01.03
soldering  (0) 2006.12.14
hardware term  (0) 2006.02.21
자이레이션  (0) 2006.01.22
posted by maetel