Lab_interaccio/2019/RAQUETA-Flaix/test_button/test_button.ino

37 lines
559 B
Arduino
Raw Normal View History

2025-02-25 21:29:42 +01:00
#include <SPI.h>
#include "Adafruit_NeoPixel.h"
#define SDO1 4
#define SDO2 8
#define SDO3 3
#define NUMPIXELS1 300 // fuego
#define NUMPIXELS2 150
#define NUMPIXELS3 150
#define BUTTON 12 //botón en GPIO12 (D6)
volatile int estado = LOW; //estado inicial
//void ICACHE_RAM_ATTR parpadeo();
void setup() {
Serial.begin(9600);
pinMode(BUTTON, INPUT_PULLUP);
attachInterrupt(BUTTON,parpadeo,FALLING);
delay(2000);
}
void parpadeo() {
estado = !estado;
Serial.println(estado);
}
void loop()
{
}