Skip to content
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
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
2
2
3
3
# The workflow will run on schedule and labeled pull requests
4
4
on :
30
30
test-boards :
31
31
needs : find-boards
32
32
runs-on : ubuntu-latest
33
- if : ${{ needs.changes .outputs.services != '' }}
33
+ if : ${{ needs.find-boards .outputs.fqbns != '' }}
34
34
35
35
env :
36
36
REPOSITORY : |
58
58
- --warnings="all"
59
59
exit-on-fail : true
60
60
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