1- /* This sketch will test everything on the carrier board
2-
3- This library "Arduino_IOTSKcarrier.h" wraps the 4 sensor's libraries to make it more compact
4- It has also the Relays to make it easier to use them
5-
6- The TFT display library is accesed by "display" instead of "tft"
7-
8- Below you will see how to access everything inside the Carrier, not every functionalities
1+ /*
2+ This sketch will test the carrier board
3+ Unless the touch pads
94*/
105
116#include < Arduino_MKRIoTCarrier.h>
@@ -31,22 +26,21 @@ void setup() {
3126 Serial.begin (9600 );
3227 while (!Serial); // Wait to open the Serial monitor to start the program and see details on errors
3328
34- // SD card
35- // You can init the SD card with SD.begin(SD_CS)
36- // SD_CS refers to pin 0
37-
3829 // Init everything and outputs the errors
3930 carrier.begin ();
40-
41-
4231}
4332
4433void loop () {
4534 // put your main code here, to run repeatedly:
4635 // LED show up
4736 // ( led index , red , green , blue )
48- carrier.leds .setPixelColor (0 , 0 , 0 , 20 );
37+ carrier.leds .setPixelColor (0 , 0 , 0 , 20 );
38+ carrier.leds .setPixelColor (1 , 0 , 20 , 0 );
39+ carrier.leds .setPixelColor (2 , 20 , 0 , 0 );
40+ carrier.leds .setPixelColor (3 , 0 , 20 , 20 );
41+ carrier.leds .setPixelColor (4 , 20 , 20 , 20 );
4942 carrier.leds .show ();
43+
5044 // Function to display
5145 displayTitle ();
5246
@@ -60,8 +54,8 @@ void loop() {
6054
6155 // Simple relay open and close loop
6256 /* Relay function
63- open() - goes to Normally Open (NO) circuit, status LED will be OFF
64- close() - goes to Normally Close (NC) cirucit, status LED will be ON
57+ open() - goes to Normally Open (NO) circuit, status LED will be ON
58+ close() - goes to Normally Close (NC) cirucit, status LED will be OFF
6559 */
6660 carrier.Relay1 .close ();
6761 delay (1000 );
@@ -86,9 +80,8 @@ void loop() {
8680
8781 delay (1000 );
8882
89-
9083 // SENSORS
91- // Ambient light sensor
84+ // RGB and Light sensor
9285 // It set the values that you point inside the brackets
9386 while (! carrier.Light .colorAvailable ()) {
9487 delay (5 );
@@ -99,7 +92,7 @@ void loop() {
9992 Serial.println (light);
10093 displayLight ();
10194
102- // Env sensor
95+ // Env sensor (Temp and Hum)
10396 temperature = carrier.Env .readTemperature ();
10497 humidity = carrier.Env .readHumidity ();
10598 Serial.println (" Env sensor" );
0 commit comments