#define BOTAO 8
#define LED 13
#define BOTAO1 3
void setup() {
// put your setup code here, to run once:
pinMode(BOTAO, INPUT_PULLUP);
pinMode(BOTAO1, INPUT_PULLUP);
pinMode(LED, OUTPUT);
}
void opcao01() {
/* EXEMPLO 1
Ao pressionar o botão BT1
O LED piscará com freq de 2hz
*/
// put your main code here, to run repeatedly:
if (digitalRead(BOTAO) == LOW)
{
digitalWrite(LED, HIGH);
delay (250);
digitalWrite(LED, LOW);
delay (250);
}
}
void opcao02() {
//
bool statusBT;
statusBT = digitalRead(BOTAO1);
// put your main code here, to run repeatedly:
if (statusBT == 0)
{
digitalWrite(LED, 1);
delay (3000);
digitalWrite(LED, 0);
delay (500);
}
}
void loop() {
opcao01();
opcao02();
}