Blink Program Module
Purpose: This program demonstrates how to utilize the Atinverter library’s LED control features in a standalone application. This module is useful for confirming the operational state of the microcontroller, hardware connections, and library integration.
Blink.ino
Pseudocode:
- Include the Atinverter library
- Create a new Atinverter instance
- Set up the period of time for delaying LED operations
- Set the GPIO pins for LEDs as outputs
- Turn on LED 1
- Turn on LED 2
- Wait for the defined period
- Turn off LED 1
- Turn off LED 2
- Wait for the defined period
- Cycle through LEDs with delay
Implementation:
#include "Atinverter.h"
Atinverter atinverter;
int PERIOD = 1000;
void setup() {
atinverter.setUpLEDs();
}
void loop() {
atinverter.set1LED(atinverter.LED1R_PIN, HIGH);
atinverter.set1LED(atinverter.LED2G_PIN, HIGH);
delay(PERIOD);
atinverter.set1LED(atinverter.LED1R_PIN, LOW);
atinverter.set1LED(atinverter.LED2G_PIN, LOW);
delay(PERIOD);
atinverter.cycleLEDs(PERIOD);
}