CCCPaste

Barra de Leds en Arduino

#define PIN_LED1 0
#define PIN_LED2 1
#define PIN_LED3 2
#define PIN_LED4 3
#define PIN_LED5 4
#define PIN_LED6 5
#define CANT_LEDS 6

const int pin_led[]={PIN_LED1, PIN_LED2, PIN_LED3, PIN_LED4, PIN_LED5, PIN_LED6};

#define CONFIG_LED(x) pinMode(pin_led[x], OUTPUT)
#define LED_ON(x)     digitalWrite(pin_led[x], HIGH)
#define LED_OFF(x)    digitalWrite(pin_led[x], LOW)
#define MS_ESPERA 100

void setup() {
  for(int i=0; i= (2*CANT_LEDS)) i=0;
  if(i