Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup() {
- Serial.begin(9600);
- pinMode(12, INPUT);
- pinMode(13, OUTPUT);
- pinMode(2, OUTPUT);
- }
- void loop() {
- int v = 0;
- // Leitura sensor rede
- v = digitalRead(12);
- if (v == 0) {
- Serial.println(0);
- // Desliga a LED e a Partida
- pinMode(13, HIGH);
- pinMode(2, HIGH);
- }
- if (v == 1) {
- Serial.println(1);
- //Liga a led
- pinMode(13, LOW);
- //Dá a partida
- pinMode(2, LOW);
- delay(3000);
- pinMode(2, HIGH);
- }
- delay(3);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement