Created
April 22, 2020 20:36
-
-
Save varghes/f2175140eeb50c94bfc023afcc0f56af to your computer and use it in GitHub Desktop.
GD32VF103CBT6 Longan Nano Arduino blink code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Blink | |
* Turns on an LED on for one second, | |
* then off for one second, repeatedly. | |
*/ | |
#include <Arduino.h> | |
// Set LED_BUILTIN if it is not defined by Arduino framework | |
// #define LED_BUILTIN 2 | |
void setup() | |
{ | |
// initialize LED digital pin as an output. | |
pinMode(PA1, OUTPUT); | |
pinMode(PA2, OUTPUT); | |
pinMode(PC13, OUTPUT); | |
digitalWrite(PA1, HIGH); | |
digitalWrite(PA2, HIGH); | |
digitalWrite(PC13, HIGH); | |
} | |
void loop() | |
{ | |
// turn the LED on (HIGH is the voltage level) | |
digitalWrite(PA1, LOW); | |
digitalWrite(PA2, HIGH); | |
digitalWrite(PC13, HIGH); | |
// wait for a second | |
delay(1000); | |
// turn the LED off by making the voltage LOW | |
digitalWrite(PA1, HIGH); | |
digitalWrite(PA2, LOW); | |
digitalWrite(PC13, HIGH); | |
// wait for a second | |
delay(1000); | |
digitalWrite(PA1, HIGH); | |
digitalWrite(PA2, HIGH); | |
digitalWrite(PC13, LOW); | |
// wait for a second | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment