IoT-Bus Blink Example¶
This very simple example needs little explanation. The first line includes the Arduino framework.
#include <arduino.h>
The next line defined the GPIO of the pin of the onboard LED.
#define LEDPin 5
This line sets the GPIO pin into output mode.
pinMode(LEDPin, OUTPUT);
This line turns on the LED.
digitalWrite(LEDPin, HIGH);
This line turns off the LED.
digitalWrite(LEDPin, LOW);
This line creates 1 second delay.
delay(1000);
The full example.
#include <arduino.h>
#define LEDPin 5
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin as an output.
pinMode(LEDPin, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LEDPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LEDPin, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}