Skip to content

Instantly share code, notes, and snippets.

@tonussi
Last active December 17, 2015 18:09
Show Gist options
  • Save tonussi/5651435 to your computer and use it in GitHub Desktop.
Save tonussi/5651435 to your computer and use it in GitHub Desktop.
Testando Sensor de Presença
int pinoSensorPIR = 7;
int bRate = 9600;
void setup() {
pinMode(pinoSensorPIR, INPUT);
Serial.begin(bRate);
}
void loop() {
Serial.println(!digitalRead(pinoSensorPIR));
//0 nada detectado
//1 algo detectado
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment