Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit b13ad38

Browse files
authored
Add RGB_LED_Test example
This example tests LEDR, LEDB and LEDG, accessed via WiFiNINA module. Credit of @JAndrassy Check earlephilhower/arduino-pico#404
1 parent 2ee1412 commit b13ad38

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/****************************************************************************************************************************
2+
RGB_LED_Test.ino
3+
4+
This example tests LEDR, LEDB and LEDG, accessed via WiFiNINA module.
5+
Credit of https://github.com/jandrassy
6+
Check https://github.com/earlephilhower/arduino-pico/pull/404
7+
8+
Built by Khoi Hoang https://github.com/khoih-prog/WiFiNINA_Generic
9+
Licensed under GPLv3 license
10+
11+
Copyright (c) 2018 Arduino SA. All rights reserved.
12+
Copyright (c) 2011-2014 Arduino LLC. All right reserved.
13+
14+
This library is free software; you can redistribute it and/or
15+
modify it under the terms of the GNU Lesser General Public
16+
License as published by the Free Software Foundation; either
17+
version 2.1 of the License, or (at your option) any later version.
18+
19+
This library is distributed in the hope that it will be useful,
20+
but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22+
Lesser General Public License for more details.
23+
24+
You should have received a copy of the GNU Lesser General Public
25+
License along with this library; if not, write to the Free Software
26+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27+
*****************************************************************************************************************************/
28+
29+
//#include <WiFiNINA.h>
30+
#include <WiFiNINA_Generic.h>
31+
32+
void setup()
33+
{
34+
Serial.begin(115200);
35+
while (!Serial);
36+
37+
Serial.print("RGB_LED_Test on ");
38+
Serial.print(BOARD_NAME);
39+
Serial.print(" using ");
40+
41+
#if __has_include("WiFiNINA.h")
42+
Serial.println("WiFiNINA Library");
43+
#elif __has_include("WiFiNINA_Generic.h")
44+
Serial.println("WiFiNINA_Generic Library");
45+
#else
46+
#error Error. No WiFiNINA or WiFiNINA_Generic included
47+
#endif
48+
49+
pinMode(LEDR, OUTPUT);
50+
pinMode(LEDG, OUTPUT);
51+
pinMode(LEDB, OUTPUT);
52+
}
53+
54+
void loop()
55+
{
56+
digitalWrite(LEDR,HIGH); // Turn On RED LED
57+
delay(250);
58+
digitalWrite(LEDR,LOW); // Turn Off RED LED
59+
60+
digitalWrite(LEDG,HIGH); // Turn On GREEN LED
61+
delay(250);
62+
digitalWrite(LEDG,LOW); // Turn Off GREEN LED
63+
64+
digitalWrite(LEDB,HIGH); // Turn On BLUE LED
65+
delay(250);
66+
digitalWrite(LEDB,LOW); // Turn Off BLUE LED
67+
}

0 commit comments

Comments
 (0)