1.GPIO port
Operate the GPIO port of BiBoard
There is no separate GPIO port on BiBoard, but the multiplexed serial port 2 (pin 16, 17) or the PWM pin of the unused PWM servo interface can be used as GPIO port. The GPIO port is also relatively simple to use. After configuring the input and output mode, the usage is exactly the same as that of Arduino UNO. You can use any IO control program of Arduino UNO, just change the number of IO .
1
/* In this demo, we use TX2, RX2 as general purpose IO
2
* TX2 : IO17
3
* RX2 : IO16
4
*/
5
6
void setup() {
7
// initialize digital pin 16 & 17 as an output.
8
pinMode(16, OUTPUT);
9
pinMode(17, OUTPUT);
10
}
11
12
// the loop function runs over and over again forever
13
void loop() {
14
15
digitalWrite(16, HIGH); // GPIO 16 & 17 HIGH
16
digitalWrite(17, HIGH);
17
delay(1000); // wait for a second
18
19
digitalWrite(16, LOW); // GPIO 16 & 17 LOW
20
digitalWrite(17, LOW);
21
delay(1000); // wait for a second
22
}
Copied!
Last modified 6mo ago
Export as PDF
Copy link