Expansion-Board XIAO-SAMD21 Grove-OLED
Expansion Board Base[edit]
Sur la partie supérieur de la plaque base :
User Button
Passive Buzzer
Prise JST2.0 Lipo Battery
5V Servo Connector
RTC Chip : PCF8563
OLED Display 0.96"
Sur la partie inférieur on trouve :
RTC Battery Holder :CR1220
MiccroSD Card Slot
images[edit]
Liens[edit]
https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html
https://wiki.seeedstudio.com/Seeeduino-XIAO-Expansion-Board/#rtc-clock-display
https://www.seeedstudio.com/Seeeduino-XIAO-Pre-Soldered-p-4747.html
Installation[edit]
> Click on File > Preference, and fill Additional Boards Manager URLs with the url below:
https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json
>
Click Tools-> Board-> Boards Manager..., print keyword "Seeed Studio XIAO SAMD21" in the searching blank. Here comes the "Seeed SAMD Boards". Install it.
>
After installing the board, click Tools-> Board, find "Seeed Studio XIAO " and select it. Now you have already set up the board of Seeed Studio XIAO SAMD21 for Arduino IDE.
>
Select the serial device of the Arduino board from the Tools | Serial Port menu.
>
XIAO SAMD21
https://wiki.seeedstudio.com/Seeeduino-XIAO/ >
code[edit]
Hello World!
#include <Arduino.h>
#include <U8x8lib.h>
#include <Wire.h>
U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // OLEDs without Reset of the Display
void setup(void) {
u8x8.begin();
u8x8.setFlipMode(1); // set number from 1 to 3, the screen word will rotary 180
}
void loop(void) {
u8x8.setFont(u8x8_font_chroma48medium8_r);
u8x8.setCursor(0, 0);
u8x8.print("Hello World!");
}
RTC clock display
uses RTC to display the clock on the OLED
#include <Arduino.h>
#include <U8x8lib.h>
#include <PCF8563.h>
PCF8563 pcf;
#include <Wire.h>
U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // OLEDs without Reset of the Display
void setup() {
Serial.begin(115200);
u8x8.begin();
u8x8.setFlipMode(1);
Wire.begin();
pcf.init();//initialize the clock
pcf.stopClock();//stop the clock
pcf.setYear(20);//set year
pcf.setMonth(10);//set month
pcf.setDay(23);//set dat
pcf.setHour(17);//set hour
pcf.setMinut(33);//set minut
pcf.setSecond(0);//set second
pcf.startClock();//start the clock
}
void loop() {
Time nowTime = pcf.getTime();//get current time
u8x8.setFont(u8x8_font_chroma48medium8_r); // choose a suitable font
u8x8.setCursor(0, 0);
u8x8.print(nowTime.day);
u8x8.print("/");
u8x8.print(nowTime.month);
u8x8.print("/");
u8x8.print("20");
u8x8.print(nowTime.year);
u8x8.setCursor(0, 1);
u8x8.print(nowTime.hour);
u8x8.print(":");
u8x8.print(nowTime.minute);
u8x8.print(":");
u8x8.println(nowTime.second);
delay(1000);
}
u8g2 library
https://github.com/olikraus/U8g2_Arduino
PCF8563 library
https://github.com/Bill2462/PCF8563-Arduino-Library