7/23/22, 9:39 PM
Seeeduino XIAO Expansion board - Seeed Wiki
https://wiki.seeedstudio.com/Seeeduino-XIAO-Expansion-Board/
19/66
Step 1
. Install the Seeeduino XIAO on the Expansion board then
conect the Type-C cable.
Step 2
. Install the
[https://github.com/olikraus/U8g2_Arduino]
[https://github.com/Bill2462/PCF8563-Arduino-
[https://wiki.seeedstudio.com/How_to_install_Arduino_Library/]
.
Step 3
. Copy the code and stick on the Ardiono IDE then upload it.
1
#
include
<Arduino.h>
2
#
include
<U8x8lib.h>
3
#
include
<PCF8563.h>
4
PCF8563 pcf;
5
#
include
<Wire.h>
6
7
U8X8_SSD1306_128X64_NONAME_HW_I2C
u8x8
(
/* clock=*/
PIN_WI
8
9
void
setup
() {
10
Serial.begin(
115200
);
11
u8x8.begin();
12
u8x8.setFlipMode(
1
);
13
Wire.begin();
14
pcf.init();
//initialize the clock
15
pcf.stopClock();
//stop the clock
16
pcf.setYear(
20
);
//set year
17
pcf.setMonth(
10
);
//set month
18
pcf.setDay(
23
);
//set dat
19
pcf.setHour(
17
);
//set hour
20
pcf.setMinut(
33
);
//set minut
21
pcf.setSecond(
0
);
//set second
22
pcf.startClock();
//start the clock
23
}
24
25
void
loop
() {
26
Time nowTime = pcf.getTime();
//get current time
27
u8x8.setFont(u8x8_font_chroma48medium8_r);
// choose
28