37 lines
559 B
Arduino
37 lines
559 B
Arduino
|
|
||
|
#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()
|
||
|
{
|
||
|
|
||
|
|
||
|
|
||
|
}
|