#include "Pin.h"
#define DEFAULT_PIN (22) // (onboard LED)
#define OFF (0)
#define ON (1)
#define DELAY_MS (100)
// function prototypes
void turn_led_on(int);
void turn_led_off(int);
int LED_PINS[] = {23, 22, 32, 33, 25, 26, 27, 14, 12, 13};
int num_pins = sizeof(LED_PINS) / sizeof(int);
void setup() {
//empty
}
void loop() {
for ( int i = 0; i < num_pins; i++ ) {
turn_led_on(LED_PINS[i]);
}
for ( int i = 0; i < num_pins; i++ ) {
turn_led_off(LED_PINS[num_pins-1-i]);
}
}
void turn_led_on( int led_pin = DEFAULT_PIN ) {
Pin pin(led_pin, Pin::Direction::OUT, ON);
delay(DELAY_MS);
}
void turn_led_off( int led_pin = DEFAULT_PIN ) {
Pin pin(led_pin, Pin::Direction::OUT, OFF);
delay(DELAY_MS);
}