File tree Expand file tree Collapse file tree 3 files changed +28
-22
lines changed
hardware/AMEL/samd/libraries/SME_basic/examples Expand file tree Collapse file tree 3 files changed +28
-22
lines changed Original file line number Diff line number Diff line change 99 int i = 0 ;
1010
1111void setup () {
12- LED_GREEN_INIT;
13- LED_BLUE_INIT;
14- LED_RED_INIT;
12+
13+ // LED & User Button are already initialized by the SME core.
14+ // it is not required to do here
1515 pinMode (PIN_LED_RXL, OUTPUT);
1616 pinMode (PIN_LED_TXL, OUTPUT);
1717
@@ -22,30 +22,32 @@ void loop() {;
2222 switch (i) {
2323 case 0 :
2424 i++;
25- LED_GREEN_ON (HIGH);
25+ ledGreenLight (HIGH);
2626 break ;
2727
2828 case 1 :
2929 i++;
30- LED_RED_ON (HIGH);
30+ ledRedLight (HIGH);
3131 break ;
3232
3333 case 2 :
3434 i = 0 ;
35- LED_BLUE_ON (HIGH);
35+ ledBlueLight (HIGH);
3636 break ;
3737
3838 default :
3939 break ;
4040 }
41+
4142 digitalWrite (PIN_LED_RXL, LOW);
4243 digitalWrite (PIN_LED_TXL, LOW);
4344 delay (100 );
4445
4546
46- LED_GREEN_ON (LOW);
47- LED_BLUE_ON (LOW);
48- LED_RED_ON (LOW);
47+ ledGreenLight (LOW);
48+ ledBlueLight (LOW);
49+ ledRedLight (LOW);
50+
4951 digitalWrite (PIN_LED_RXL, HIGH);
5052 digitalWrite (PIN_LED_TXL, HIGH);
5153 delay (100 );
Original file line number Diff line number Diff line change 88#include < Arduino.h>
99
1010void setup () {
11+ // LED & User Button are already initialized by the SME core.
12+ // it is not required to do here
13+
1114 SerialUSB.begin (115200 );
1215}
1316
@@ -17,11 +20,12 @@ void loop() {
1720
1821 if (smeInitError == 0 ){
1922 SerialUSB.println (" SUCCEED !" );
20- LED_GREEN_ON (HIGH);
23+ ledGreenLight (HIGH);
2124 }
2225 else {
26+ // ERROR !!!!!!! FLASH EVERYTHING
27+
2328 SerialUSB.println (" ERROR !" );
24- // // ERROR !!!!!!! FLASH EVERYTHING
2529
2630 pinMode (PIN_LED_RXL, OUTPUT);
2731 pinMode (PIN_LED_TXL, OUTPUT);
@@ -31,17 +35,17 @@ void loop() {
3135 switch (i) {
3236 case 0 :
3337 i++;
34- LED_GREEN_ON (HIGH);
38+ ledGreenLight (HIGH);
3539 break ;
3640
3741 case 1 :
3842 i++;
39- LED_RED_ON (HIGH);
43+ ledRedLight (HIGH);
4044 break ;
4145
4246 case 2 :
4347 i=0 ;
44- LED_BLUE_ON (HIGH);
48+ ledBlueLight (HIGH);
4549 break ;
4650
4751 default :
@@ -52,9 +56,9 @@ void loop() {
5256 delay (100 );
5357
5458
55- LED_GREEN_ON (LOW);
56- LED_BLUE_ON (LOW);
57- LED_RED_ON (LOW);
59+ ledGreenLight (LOW);
60+ ledBlueLight (LOW);
61+ ledRedLight (LOW);
5862 digitalWrite (PIN_LED_RXL, HIGH);
5963 digitalWrite (PIN_LED_TXL, HIGH);
6064 delay (100 );
Original file line number Diff line number Diff line change 1515// the setup function runs once when you press reset or power the board
1616void setup () {
1717
18- // LED & User Button are already initilized by the SME core.
18+ // LED & User Button are already initialized by the SME core.
1919 // it is not required to do here
2020}
2121
2222// the loop function runs over and over again forever
2323void loop () {
2424
2525 if (button1IsPressed ()) {
26- LED_BLUE_ON (HIGH);
26+ ledBlueLight (HIGH);
2727 } else {
28- LED_BLUE_ON (LOW);
28+ ledBlueLight (LOW);
2929 }
3030
3131 if (button2IsPressed ()) {
32- LED_RED_ON (HIGH);
32+ ledRedLight (HIGH);
3333 } else {
34- LED_RED_ON (LOW);
34+ ledRedLight (LOW);
3535 }
3636}
You can’t perform that action at this time.
0 commit comments