topical media & game development

talk show tell print

graphic-processing-algorithm-Ch11-p288-p288.pde / pde



  void setup(){
    Serial.begin(9600); //start the serial port in order to write
    pinMode(2,INPUT); // set the pin 2 to input
  }
  void loop(){
    int val = digitalRead(2); //read from the pin 2
    if(val==LOW) //if the current is low (i.e. pressed) then
      Serial.println(“LOW”); //let me know
  }
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.