#include // Libraries previously installed #include #include static uint16_t up, down; // extracted from Neil Program static uint16_t arriba, abajo; SoftwareSerial mySerial(9, 5); void setup() { pinMode(A2, OUTPUT); // Declaring the first sensor pin out from my board mySerial.begin(4800); //mySerial.println("Hello, world?"); } void loop() { up = 0; // initial value for the states of sensor to up to 0 down = 0; // initial value to 0 for down for (int count = 0; count < 100; ++count) { _delay_us(100); digitalWrite(A2, 1); //the pin out and his state arriba = analogRead(A3); up += arriba; _delay_us(100); digitalWrite(A2, 0); abajo = analogRead(A3); down += abajo;} arriba = 0; abajo = 0; arriba = analogRead(A4); _delay_us(100); if (arriba > 600) { mySerial.println(arriba); } _delay_ms(500); }