background image

7/23/22, 9:39 PM

Seeeduino XIAO Expansion board - Seeed Wiki

https://wiki.seeedstudio.com/Seeeduino-XIAO-Expansion-Board/

1/66

Seeeduino XIAO Expansion board

[https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-

4746.html]

A powerful functional expansion board for Seeeduino XIAO of only
half Raspberry Pi 4 size. It enables build prototype and project in

Содержание XIAO

Страница 1: ...tudio com Seeeduino XIAO Expansion Board 1 66 Seeeduino XIAO Expansion board https www seeedstudio com Seeeduino XIAO Expansion board p 4746 html A powerful functional expansion board for Seeeduino XIAO of only half Raspberry Pi 4 size It enables build prototype and project in ...

Страница 2: ...duino XIAO Expansion board p 4746 html There is a slight difference between the pins and refer to the Pinout it is easy to manage Seeeduino XIAO XIAO RP2040 and XIAO BLE are compatible to the XIAO expansion board Features Quick Prototyping Easy debug and Reset with RESET button and SWD pin led out to male header 0 96 OLED enables visual data display without PC serial monitor Convenient plug and pl...

Страница 3: ... and project building Mini Size Compact and elegant with only half Raspberry Pi 4 size especially suitable for projects require mini size Specification Item Value Operating voltage 5V 3 7V Lithium Battery Charging current 460mA Max RTC timer precision 1 5S DAY 25 C RTC battery CR1220 Display 0 96 OLED display Expandable memory MicroSD card Grove Interface Grove IIC 2 Grove UART 1 A0 D0 Grove 1 Oth...

Страница 4: ...tem Value SeeeduinoXIAO Expansion Board 1 Getting Started Materials Required Note This product does not include Seeeduino XIAO and battery please click this link to get Seeeduino XIAO https www seeedstudio com Seeeduino XIAO Arduino Microcontroller SAMD21 Cortex M0 p 4426 html gclid Cj0KCQjwufn8BRCwARIsAKzP695mYBI8wwzrR8rXiJgv9QBK5DeTJG CU9bzXvzGUheFVZxqHcuw0SgYaAqDqEALw_wcB edit ...

Страница 5: ...O Expansion board Get ONE Now https www seeedstudio com Seeeduino XIAO Arduino Microcontroller SAMD21 Cortex M0 p 4426 html Get ONE Now https www seeedstudio com Seee XIAO Expansion board p 4746 html Hardware Overview There are an external MicroSD card slot and RTC Battery Holder the MicroSD card mostly is used for saving and run the python py file ...

Страница 6: ...eeed Wiki https wiki seeedstudio com Seeeduino XIAO Expansion Board 6 66 the RTC is for tracks the current time and can be used to program actions at a specific time Pinout Diagram External headers pin description for Grove Shield for Seeeduino XIAO ...

Страница 7: ...studio com Seeeduino XIAO Expansion Board 7 66 Expansion Board Usage Connection Put the Seeeduino XIAO on the expansion board the XIAO green LED should light up If you want to know more about Seeeduino XIAO please click Seeeduino XIAO https wiki seeedstudio com Seeeduino XIAO ...

Страница 8: ...hat battery will help you to solve the power supply issue when you plug the battery please watch out for the positive and negative anodes follow the picture to connect the battery in case of damage the board Note Please plug the Seeeduino XIAO on the expansion board first then plug Type C Remember pluing Seeeduino XIAO into the middle of the two female header connectors otherwise you will damage t...

Страница 9: ...tion the board charged the battery when you plug the battery cable and the type C cable and switch the button to on As the below picture if the LED flashing which means the battery does not charge or the board does not connect battery if the LED keeps light on which is mean the battery is charging Modules on the expansion board ...

Страница 10: ...ock with battery backup enable maintain accurate time when the main power is turned off Expandable memory With a MicroSD card slot on the back no worry on memory limit any more when adding libraries and using circuit python User button Besides the RESET button also provide with another user defined button Passive buzzer Same passive buzzer on Wio Terminal with which you could change the PMW freque...

Страница 11: ... servo and sensor connection OLED Display This example introduces how to use the OLED display on the XIAO expansion board Step 1 Install the Seeeduino XIAO on the Expansion board then conect the Type C cable Step 2 Install the u8g2 https github com olikraus U8g2_Arduino library this is the guide how to install the library https wiki seeedstudio com How_to_install_Arduino_Library ...

Страница 12: ...troduces how to use the button on the XIAO expansion board to control the LED on the Seeeduino XIAO 1 include Arduino h 2 include U8x8lib h 3 include Wire h 4 5 U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8 clock PIN_WI 6 7 void setup void 8 u8x8 begin 9 u8x8 setFlipMode 1 set number from 1 to 3 the s 10 11 12 void loop void 13 u8x8 setFont u8x8_font_chroma48medium8_r 14 u8x8 setCursor 0 0 15 u8x8 print ...

Страница 13: ... the code and stick on the Ardiono IDE then upload it Code 1 const int buttonPin 1 the number of the pushbut 2 int buttonState 0 variable for reading the 3 4 void setup 5 initialize the LED pin as an output 6 pinMode LED_BUILTIN OUTPUT 7 initialize the pushbutton pin as an input 8 pinMode buttonPin INPUT_PULLUP 9 10 11 12 void loop 13 read the state of the pushbutton value 14 buttonState digitalRe...

Страница 14: ... default connected to the Pin A3 if you want to remove the buzzer function just follow the below picture cut off the line Play Song with Passive Buzzer 15 16 check if the pushbutton is pressed If it is the bu 17 if buttonState HIGH 18 turn LED on 19 digitalWrite LED_BUILTIN HIGH 20 else 21 turn LED off 22 digitalWrite LED_BUILTIN LOW 23 24 25 ...

Страница 15: ...h 28 the number of notes 3 char notes GGAGcB GGAGdc GGxecBA yyecdc 4 int beats 2 2 8 8 8 16 1 2 2 8 8 8 16 5 int tempo 150 6 void playTone int tone int duration 7 for long i 0 i duration 1000L i tone 2 8 digitalWrite speakerPin HIGH 9 delayMicroseconds tone 10 digitalWrite speakerPin LOW 11 delayMicroseconds tone 12 13 14 15 void playNote char note int duration 16 char names C D E F G A B 17 c d e...

Страница 16: ...o control servo via integration ports on the XIAO expansion board 28 for int i 0 i 17 i 29 if names i note 30 int newduration duration SPEE 31 playTone tones i newduration 32 33 34 35 36 void setup 37 pinMode speakerPin OUTPUT 38 39 40 void loop 41 for int i 0 i length i 42 if notes i 43 delay beats i tempo rest 44 else 45 playNote notes i beats i tempo 46 47 pause between notes 48 delay tempo 49 ...

Страница 17: ...opy the code and stick on the Ardiono IDE then upload it 1 include Servo h 2 define ROTARY_ANGLE_SENSOR A0 3 define ADC_REF 3 reference voltage of ADC is 3v If the 4 define GROVE_VCC 3 VCC of the grove interface is norma 5 define FULL_ANGLE 300 full value of the rotary angle i 6 7 Servo myservo create servo object to control a servo 8 twelve servo objects can be created on most boards 9 10 int pos...

Страница 18: ...D 14 pinMode ROTARY_ANGLE_SENSOR INPUT 15 myservo attach 5 attaches the servo on pin 9 to t 16 17 18 void loop 19 20 float voltage 21 int sensor_value analogRead ROTARY_ANGLE_SENSOR 22 voltage float sensor_value ADC_REF 1023 23 float degrees voltage FULL_ANGLE GROVE_VCC 24 Serial println The angle between the mark and the star 25 Serial println degrees 26 delay 50 27 myservo write degrees 28 ...

Страница 19: ...n 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 setD...

Страница 20: ...for Seeeduino XIAO Expansion Board 29 u8x8 setCursor 0 0 30 u8x8 print nowTime day 31 u8x8 print 32 u8x8 print nowTime month 33 u8x8 print 34 u8x8 print 20 35 u8x8 print nowTime year 36 u8x8 setCursor 0 1 37 u8x8 print nowTime hour 38 u8x8 print 39 u8x8 print nowTime minute 40 u8x8 print 41 u8x8 println nowTime second 42 delay 1000 43 ...

Страница 21: ...https wiki seeedstudio com Seeeduino XIAO Expansion Board 21 66 https www seeedstudio com XIAO p 4812 html We made this acrylic case https www seeedstudio com XIAO p 4812 html for protecting the Seeeduino XIAO expansion board those are acrylic case components ...

Страница 22: ...ino XIAO Expansion board Seeed Wiki https wiki seeedstudio com Seeeduino XIAO Expansion Board 22 66 Compare with the Grove Shield for Seeeduino XIAO the Seeeduino XIAO expansion board added a lot useful modules for the users ...

Страница 23: ... introduce how to install and run the official CircuitPython https circuitpython org by Adafruit Industries on the Seeeduino XIAO development board https www seeedstudio com Seeeduino XIAO Pre Soldered p 4747 html CircuitPython is a programming language designed to simplify experimenting and learning to program on low cost microcontroller boards It makes getting started easier than ever with no up...

Страница 24: ...hon what is circuitpython Installing CircuitPython Step 1 Install the Seeeduino XIAO on the Expansion board then conect the Type C cable Step 2 Download the official CircuitPython Bootloader for Seeeduino XIAO https circuitpython org board seeeduino_xiao A uf2 the flie will be store in your PC download Step 3 Entering the DFU bootloader mode by press the reset button twice quickly on the XIAO expa...

Страница 25: ... XIAO Expansion Board 25 66 Step 4 An external drive named Arduino should appear in your PC Drag the downloaded CircuitPython uf2 files to the Arduino drive Step 5 Once loaded the CircuitPython bootloader unplug the USB Type C and re connect A new external drive called CIRCUITPY should be appear ...

Страница 26: ...ed to do it s to write you python program and name it main py and drag it onto the CIRCUITPY drive CircuitPyhton Blink example There is a simple example introduce how to use the CirsuitPython on the seeeduino XIAO Step 1 Create a txt file name main on the CIRCUITPY drive Note The main name is one of these code txt code py main py main txt there is more detail about this behavior edit ...

Страница 27: ...on board built in an MicroSD card slot for extending the store space so you can follow this instruction to learn how to run the circuitpython on the MicroSD card https circuitpython readthedocs io en 6 0 x README html behavior 1 import time 2 import board 3 from digitalio import DigitalInOut Direction 4 5 led DigitalInOut board D13 6 led direction Direction OUTPUT 7 8 while True 9 led value True 1...

Страница 28: ...dio com Seeeduino XIAO Expansion Board installing circuitpython chapter Step 3 Download lib https files seeedstudio com wiki Seeeduino XIAO Expansion Board lib zip unzips the file then replace it with the new lib in the CIRCUITPY Step 4 Download the main py https files seeedstudio com wiki Seeeduino XIAO Expansion Board main py file in the CIRCUITPY drive The main py code Step 5 Download the sd py...

Страница 29: ...io com wiki Seeeduino XIAO Expansion Board buzzer py in the MicroSD card 1 import os 2 import adafruit_sdcard 3 import board 4 import busio 5 import digitalio 6 import storage 7 import sys 8 9 Connect to the card and mount the filesystem for Seeedu 10 spi busio SPI board SCK board MOSI board MISO 11 cs digitalio DigitalInOut board D2 12 sdcard adafruit_sdcard SDCard spi cs 13 vfs storage VfsFat sd...

Страница 30: ...66 Step 2 Open main py in the CIRCUITPY drive Step 3 Add import buzzer in the main py file When you finish all the step the buzzer will work If you to run other python files in the MicroSD card please imitate the example Note If you want back to Arduino mode you just need to upload any programme on the Arduino IDE edit ...

Страница 31: ...AO Expansion Board 31 66 Demo Project 1 Remote control fan Overview This wiki introduce how to make a Mini fan to plase on your room keep cool Feature Automatic swing fan Component required Seeeduino XIAO https www seeedstudio com Seeeduino XIAO Arduino Microcontroller SAMD21 Cortex M0 p 4426 html ...

Страница 32: ...seeedstudio com Grove Mini Fan v1 1 html Grove Servo https www seeedstudio com Grove Servo html Grove IR Infrared Receiver https www seeedstudio com Grove Infrared Receiver html Hardware Connection Please follow the same color line to connect each sensor on the board Please connect the fan grove cable to D0 servo grove cable to I2C IR grove cable to D7 Arduino Instructions Step 1 Follow the connec...

Страница 33: ...s the button make sure it can work safely Code 1 include IRremote h 2 include Servo h 3 4 Servo myservo create servo object to control a servo 5 int RECV_PIN 7 set pin 2 as IR control 6 7 IRrecv irrecv RECV_PIN 8 9 decode_results results 10 11 int pos 90 variable to store the servo position 12 int fanPin 0 set D6 as control switch 13 int fanState LOW 14 int IO 0 15 16 void setup 17 18 Serial begin...

Страница 34: ...ite fanPin fanState 39 delay 100 40 41 42 43 if results value 2155821255 fan swing t 44 for pos pos 89 pos 1 goes from 0 deg 45 in steps of 1 degree 46 myservo write pos tell servo to 47 48 delay 40 waits 15ms fo 49 if irrecv decode results 50 irrecv resume 51 if results value 2155870215 52 break 53 54 55 56 57 if results value 2155870215 fan swing t 58 for pos pos 1 pos 1 goes from 90 deg 59 myse...

Страница 35: ...d Wiki https wiki seeedstudio com Seeeduino XIAO Expansion Board 35 66 Project 2 Remote control car Overview 68 69 Serial println pos 70 Serial println results value HEX 71 Serial println results value 72 irrecv resume recive next int 73 74 delay 100 75 ...

Страница 36: ...AMD21 Cortex M0 p 4426 html Seeeduino XIAO expansion board https www seeedstudio com Seeeduino XIAO Expansion board p 4746 html Grove I2C Mini Motor Driver https www seeedstudio com Grove I2C Mini Motor Driver html DC Motor https www seeedstudio com 130 DC Motor p 2023 html Grove IR Infrared Receiver https www seeedstudio com Grove Infrared Receiver html Hardware Connection Please follow the same ...

Страница 37: ...Studio Seeed_Arduino_IRSendRev and Motor driver https github com Seeed Studio Drv8830_Motor_Driver library this is the guide how to install the library https wiki seeedstudio com How_to_install_Arduino_Library Step 4 Copy the code stick on the Aruino IDE then upload it Code 1 include Arduino h 2 include U8g2lib h 3 include IRremote h 4 include SparkFunMiniMoto h Include the MiniMoto li 5 Create tw...

Страница 38: ...ableIRIn Start the receiver 19 pinMode FAULTn INPUT 20 21 22 void loop 23 if irrecv decode results checking IR signal 24 if results value 2155862055 25 Forward 2155862055 26 motor0 drive 600 27 motor1 drive 600 28 delayUntil 20 29 30 if results value 2155813095 31 Brake 2155813095 32 motor0 brake 33 motor1 brake 34 delay 100 35 36 if results value 2155823295 37 backward 2155823295 38 motor0 drive ...

Страница 39: ... 600 51 motor1 drive 600 52 delayUntil 20 53 54 if results value 2155837575 55 turn left 2155837575 56 motor0 drive 600 57 motor1 drive 600 58 delayUntil 20 59 60 irrecv resume recive next int 61 62 63 delay 100 64 65 66 void delayUntil unsigned long elapsedTime 67 unsigned long startTime millis 68 while startTime elapsedTime millis 69 if digitalRead FAULTn LOW 70 byte result motor0 getFault 71 re...

Страница 40: ...larm and the LED ring will display the red colour only your finger has registered on the board when the begin then put your finger on the board when fingerprint pass the authorization the LED ring will display green colour Feature Easy to record your fingerprint LED ring can remind you the lock state The OLED screen can display the current information The buzzer can remind you the fingerprint whet...

Страница 41: ...r Sensor https www hackster io products buy 80263 s BAhJIhMzNzA5MzAsUHJvamVjdAY6BkVG 0A Seeed Grove RGB LED Ring 24 https www hackster io products buy 80264 s BAhJIhMzNzA5MzAsUHJvamVjdAY6BkVG 0A Seeed Grove Servo https www hackster io products buy 80265 s BAhJIhMzNzA5MzAsUHJvamVjdAY6BkVG 0A Hardware Connection Please follow the same color line to connect each sensor on the board Please connect the...

Страница 42: ...tps www arduino cc en Main software Step 3 Install the u8g2 https github com olikraus U8g2_Arduino Servo https github com arduino libraries Servo Seeed_Arduino_KCT202 https github com Seeed Studio Seeed_Arduino_KCT202 and Seeed_LED_Ring https github com Seeed Studio Seeed_LED_Ring library this is the guide how to install the library https wiki seeedstudio com How_to_install_Arduino_Library Step 4 ...

Страница 43: ...The screen will display finger recording at the begin you just need to put your finger on the finger device after that the program will analyze your fingerprint then finish registered 1 Identity authorization pass certification The screen will display Please verify you need to put your finger on the fingerprint device then the LED ring will turn to green colour ...

Страница 44: ...dstudio com Seeeduino XIAO Expansion Board 44 66 1 Identity authorization unpass certification If other people put their finger on it the LED ring will turn to red colour and the board will display Identity deny meanwhile the alarm will be work Code content_copy content_copy ...

Страница 45: ...2 14 Adafruit_NeoPixel strip Adafruit_NeoPixel PIXEL_COUNT 15 16 Servo myservo 17 18 Protocol_oprt oprt 19 uint8_t err_code 0 20 uint8_t param 10 21 uint32_t param_len 22 int pos 0 23 const int buttonPin 1 24 int buttonState 0 25 int BuzzerPin A3 26 27 U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8 reset U8X8_ 28 29 void setup void 30 Serial begin 115200 31 strip setBrightness 255 32 strip begin 33 strip ...

Страница 46: ...be ready 53 delay 500 54 colorWipe strip Color 0 125 125 50 55 u8x8 setCursor 0 3 56 u8x8 print 3 57 delay 500 58 u8x8 setCursor 0 3 59 u8x8 print 2 60 delay 500 61 u8x8 setCursor 0 3 62 u8x8 print 1 63 delay 500 64 u8x8 setCursor 0 3 65 u8x8 print Registered 66 delay 800 67 68 69 70 void loop void 71 uint16_t finger_num 0 72 73 kct202 autoVerifyFingerPrint CHECK_ALL_FINGER_TEMP 74 LED_OFF_AFTER_G...

Страница 47: ...ite BuzzerPin 0 96 delay 100 97 98 for pos 0 pos 90 pos 1 99 myservo write pos 100 delay 15 101 102 while 1 103 pinMode buttonPin INPUT 104 buttonState digitalRead buttonPin 105 u8x8 setFont u8x8_font_chroma48medium8_r 106 u8x8 setCursor 0 3 107 u8x8 print Please close 108 Serial println pos 109 Serial println buttonState 110 if buttonState LOW pos 91 111 for pos 91 pos 0 pos 1 goes fro 112 u8x8 s...

Страница 48: ...tFont u8x8_font_chroma48medium8_r 127 u8x8 setCursor 0 3 128 u8x8 print Identity deny 129 myservo write 0 130 delay 200 131 132 analogWrite BuzzerPin 250 133 delay 2000 134 analogWrite BuzzerPin 0 135 delay 100 136 137 u8x8 setCursor 0 3 138 u8x8 print Please retry 139 delay 1500 140 141 142 143 void colorWipe uint32_t c uint8_t wait 144 for uint16_t i 0 i strip numPixels i 145 strip setPixelColor...

Страница 49: ...his device then you will become its master The hammer needs a magnet to adsorb on the grove electromagnet until its master to unlock via fingerprint the hammer can take away Component required Seeeduino XIAO https www seeedstudio com Seeeduino XIAO Arduino Microcontroller SAMD21 Cortex M0 p 4426 html Seeeduino XIAO expansion board https www seeedstudio com Seeeduino XIAO Expansion board p 4746 htm...

Страница 50: ... Sensor https www hackster io products buy 81052 s BAhJIhMzNzQxMDUsUHJvamVjdAY6BkVG 0A Seeed Grove Electromagnet https www hackster io products buy 32769 s BAhJIhMzNzQxMDUsUHJvamVjdAY6BkVG 0A Hardware Connection Please follow the same color line to connect each sensor on the board Please connect the IR sensor grove cable to D0 Mini Motor Driver grove cable to I2C ...

Страница 51: ...o Instructions Step 1 Follow the connection picture connect all the sensor on the board Step 2 Download the Aruidno IDE https www arduino cc en Main software Step 3 Install the u8g2 https github com olikraus U8g2_Arduino and Seeed_Arduino_KCT202 https github com Seeed Studio Seeed_Arduino_KCT202 library this is the guide how to ...

Страница 52: ... 9 10 Protocol_oprt oprt 11 uint8_t err_code 0 12 uint8_t param 10 13 uint32_t param_len 14 15 int Electromagnet 0 16 17 U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8 reset U8X8_P 18 19 the setup routine runs once when you press reset 20 void setup 21 initialize the digital pin as an output 22 23 u8x8 begin 24 u8x8 setFlipMode 0 25 debug begin 115200 26 pinMode Electromagnet OUTPUT 27 digitalWrite Electr...

Страница 53: ... 1 46 delay 500 47 u8x8 setCursor 0 3 48 u8x8 print Registered 49 delay 800 50 51 52 53 54 the loop routine runs over and over again forever 55 void loop 56 57 uint16_t finger_num 0 58 kct202 autoVerifyFingerPrint CHECK_ALL_FINGER_TEMP 59 u8x8 setFont u8x8_font_chroma48medium8_r 60 u8x8 setCursor 0 3 61 u8x8 print Please verify 62 63 if 0 kct202 getVerifyResponAndparse finger_num 64 u8x8 setFont u...

Страница 54: ...t device to collect PM2 5 PM10 temperature humidity CO2 and dust particle via Grove Laser PM2 5 Sensor Grove CO2 Temperature Humidity sensor and Grove dust Sensor respectively 74 u8x8 setFont u8x8_font_chroma48medium8_r 75 u8x8 setCursor 0 3 76 u8x8 print Identity deny 77 myservo write 0 78 delay 200 79 80 u8x8 setCursor 0 3 81 u8x8 print Please retry 82 delay 1500 83 digitalWrite Electromagnet HI...

Страница 55: ... CO2 Temperature Humidity Sensor for Arduino SCD30 3 in 1 https www hackster io products buy 80471 s BAhJIhMzNzE2NzQsUHJvamVjdAY6BkVG 0A Seeed Grove Laser PM2 5 Dust Sensor Arduino Compatible HM3301 https www hackster io products buy 80472 s BAhJIhMzNzE2NzQsUHJvamVjdAY6BkVG 0A Seeed Grove Dust Sensor PPD42NS https www hackster io products buy 30140 s BAhJIhMzNzE2NzQsUHJvamVjdAY6BkVG 0A Hardware Co...

Страница 56: ...low the connection picture connect all the sensor on the board Step 2 Download the Aruidno IDE https www arduino cc en Main software Step 3 Install the u8g2 https github com olikraus U8g2_Arduino Seeed_PM2_5_sensor_HM3301 https github com Seeed Studio Seeed_PM2_5_sensor_HM3301 and Seeed_SCD30 https github com Seeed Studio Seeed_SCD30 library this is the ...

Страница 57: ...lUSB 8 9 int pin 7 10 unsigned long duration 11 unsigned long starttime 12 unsigned long sampletime_ms 5000 sampe 30s 13 unsigned long lowpulseoccupancy 0 14 float ratio 0 15 float concentration 0 16 17 const int buttonPin 1 18 int buttonState 0 19 int memu 0 20 21 U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8 reset U8X8_ 22 HM330X sensor 23 uint8_t buf 30 24 25 const char str sensor num PM1 0 concentrat...

Страница 58: ...x8 setCursor 7 0 46 u8x8 print value 47 u8x8 setCursor 11 0 48 u8x8 print ug m 49 Serial println value 50 return NO_ERROR 51 52 53 HM330XErrorCode print_result_1 const char str uint16_t 54 if NULL str 55 return ERROR_PARAM 56 57 SERIAL_OUTPUT print str 58 u8x8 setFont u8x8_font_chroma48medium8_r 59 u8x8 setCursor 0 0 60 u8x8 print PM10 61 u8x8 setCursor 7 0 62 u8x8 print value 63 u8x8 setCursor 11...

Страница 59: ...RAM 85 86 value uint16_t data 7 2 8 data 7 2 1 87 print_result_1 str 7 1 value 88 return NO_ERROR 89 90 91 92 93 30s 94 void setup 95 Serial begin 115200 96 Wire begin 97 u8x8 begin 98 u8x8 setFlipMode 0 99 scd30 initialize 100 pinMode pin INPUT 101 pinMode buttonPin INPUT_PULLUP 102 starttime millis get the current time 103 104 105 106 void loop 107 float result 3 0 108 duration pulseIn pin LOW 1...

Страница 60: ... print result 0 129 u8x8 setCursor 12 3 130 u8x8 print pmm 131 delay 1000 132 133 134 if sensor read_sensor_value buf 29 memu 0 135 SERIAL_OUTPUT println HM330X read result failed 136 137 if memu 0 138 parse_result buf 139 140 141 if millis starttime sampletime_ms memu 142 ratio lowpulseoccupancy sampletime_ms 10 0 143 concentration 1 1 pow ratio 3 3 8 pow rati 144 145 u8x8 setFont u8x8_font_chrom...

Страница 61: ...eConcentration result 164 u8x8 setFont u8x8_font_chroma48medium8_r 165 u8x8 setCursor 0 3 166 u8x8 print Temp 167 u8x8 setCursor 6 3 168 u8x8 print result 1 169 u8x8 setCursor 10 3 170 u8x8 print C 171 172 u8x8 setCursor 0 6 173 u8x8 print Humi 174 u8x8 setCursor 5 6 175 u8x8 print result 2 176 u8x8 setCursor 8 6 177 u8x8 print 178 179 delay 1000 180 181 182 if sensor read_sensor_value buf 29 memu...

Страница 62: ...m Component required Seeeduino XIAO https www seeedstudio com Seeeduino XIAO Arduino Microcontroller SAMD21 Cortex M0 p 4426 html Seeeduino XIAO expansion board https www seeedstudio com Seeeduino XIAO Expansion board p 4746 html Seeed Grove Finger clip Heart Rate Sensor https www hackster io products buy 80359 s BAhJIhMzNzExNzMsUHJvamVjdAY6BkVG 0A Hardware Connection Please follow the same color ...

Страница 63: ...e connection picture connect all the sensor on the board Step 2 Download the Aruidno IDE https www arduino cc en Main software Step 3 Install the u8g2 https github com olikraus U8g2_Arduino library this is the guide how to install the library https wiki seeedstudio com How_to_install_Arduino_Library Step 4 Copy the code stick on the Aruino IDE then upload it ...

Страница 64: ... 11 12 u8x8 begin 13 u8x8 setFlipMode 1 14 Wire begin 15 16 void loop 17 Wire requestFrom 0xA0 1 1 request 1 bytes f 18 while Wire available slave may send le 19 unsigned char c Wire read receive heart rat 20 u8x8 setFont u8x8_font_chroma48medium8_r 21 u8x8 setCursor 0 3 22 u8x8 print blood detecting 23 delay 10000 24 25 u8x8 setCursor 0 3 26 u8x8 print HeartRate 27 u8x8 setCursor 10 3 28 u8x8 pri...

Страница 65: ...Seeeduino XIAO Expansion Board document PCF8563T pdf PDF Seeeduino XIAO Expansion board_v1 0_SCH_200824 https files seeedstudio com wiki Seeeduino XIAO Expansion Board document Seeeduino 20XIAO 20Expansion 20board_ v1 0_SCH_200824 pdf SCH Seeeduino XIAO Expansion board_v1 0_200824 https files seeedstudio com wiki Seeeduino XIAO Expansion Board document Seeeduino 20XIAO 20Expansion 20board_ v1 0_20...

Страница 66: ...39 PM Seeeduino XIAO Expansion board Seeed Wiki https wiki seeedstudio com Seeeduino XIAO Expansion Board 66 66 https www seeedstudio com act 4 html utm_source wiki utm_medium wikibanner utm_campaign newpr oducts ...

Отзывы: