Details at http://atari.uniandes.edu.co/medios/cursos/dise-3117-061/persona.php?p_id=404
Remove these ads by
Signing UpStep 1Code
int antesx= 0;
int x = 0;
int val;
void setup () {
antesx = analogRead (0);
pinMode(0, OUTPUT);
Serial.begin(9600);
}
void loop () {
if( Serial.available() ) // if data is available to read
{
val = Serial.read(); // read it and store it in 'val'
if( val == 'H' ) {
digitalWrite(1, HIGH); // turn ON the LED
delay(2000);
digitalWrite(1, LOW); // otherwise turn it OFF
}
}
x = analogRead(0);
if((x <= antesx-10)||(x>= antesx+10)) {
digitalWrite (0, HIGH);
delay (500);
digitalWrite (0, LOW);
antesx = x;
}
/*Serial.print(" x es ");
Serial.print(x, DEC);
Serial.print(" antes x es ");
Serial.println(antesx, DEC);
*/
//sonia
//delay(50);
}
| « Previous Step | Download PDFView All Steps | Next Step » |










































http://wiring.org.co/ioboard/index.html
software
http://processing.org/download/