Connect the components on the breadboard according to the circuit diagram, As shown in the following picture.
Open it on your computer Arduino IDE software. Use Arduino Language encodes and controls the circuit. tap "new" Open the new sketch file. Specific configurations are not discussed here.
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
*/
void setup ()
{
// initialize digital pin PA2 as an output.
pinMode (PA2, OUTPUT) ;
}
// the loop function runs over and over again forever.
void loop ()
{
digitalWrite (PA2, HIGH) ; // turn the LED on (HIGH is the voltage level)
delay (1000) ; // wait for a second.
digitalWrite (PA2, LOW) ; // turn the LED off by making the voltage LOW
delay (1000) ; // wait for a second.
}
pinMode (PA2, OUTPUT) ;
You need to tell W801 It is INPUT still OUTPUT. We can use the built-in "function" pinMode () To do that.
digitalWrite (PA2, HIGH) ;
When using pins as output, It can be commanded as HIGH (exportation 5V) or LOW (exportation 0V) .
You can see yours LED Open and close. If you don't see the results you want, Make sure you have assembled the circuit correctly, The code has been verified and uploaded to the board.