File tree Expand file tree Collapse file tree 2 files changed +48
-3
lines changed
libraries/ESP32/examples/CI/CIBoardsTest Expand file tree Collapse file tree 2 files changed +48
-3
lines changed Original file line number Diff line number Diff line change 1- name : New Board Test
1+ name : Boards Test
22
33# The workflow will run on schedule and labeled pull requests
44on :
3030 test-boards :
3131 needs : find-boards
3232 runs-on : ubuntu-latest
33- if : ${{ needs.changes .outputs.services != '' }}
33+ if : ${{ needs.find-boards .outputs.fqbns != '' }}
3434
3535 env :
3636 REPOSITORY : |
5858 - --warnings="all"
5959 exit-on-fail : true
6060 sketch-paths :
61- " - ./libraries/ESP32/examples/ChipID/GetChipID/GetChipID .ino"
61+ " - ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest .ino"
Original file line number Diff line number Diff line change 1+ #include < Wire.h>
2+ #include < SPI.h>
3+
4+ void setup () {
5+ // UART initialization
6+ Serial.begin (9600 );
7+
8+ // I2C initialization
9+ Wire.begin ();
10+
11+ // SPI initialization
12+ SPI.begin ();
13+ }
14+
15+ void loop () {
16+ // UART echo
17+ if (Serial.available ()) {
18+ Serial.write (Serial.read ());
19+ }
20+
21+ // I2C read/write
22+ Wire.beginTransmission (0x68 ); // I2C address of device
23+ Wire.write (0x00 ); // register to read/write
24+ Wire.write (0xFF ); // data to write (if writing)
25+ Wire.endTransmission ();
26+
27+ Wire.requestFrom (0x68 , 1 ); // number of bytes to read
28+
29+ while (Wire.available ()) {
30+ Serial.println (Wire.read ());
31+ }
32+
33+ // SPI read/write
34+ digitalWrite (SS, LOW); // select slave device
35+ SPI.transfer (0x01 ); // data to write
36+ digitalWrite (SS, HIGH); // deselect slave device
37+
38+ digitalWrite (SS, LOW); // select slave device
39+ byte data = SPI.transfer (0x00 );// data to read
40+ digitalWrite (SS, HIGH); // deselect slave device
41+
42+ Serial.println (data);
43+
44+ delay (1000 ); // wait for 1 second before repeating loop
45+ }
You can’t perform that action at this time.
0 commit comments