File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 7
7
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
8
*/
9
9
10
+ #include < Arduino.h>
10
11
#include " Thing.h"
11
12
#include " WebThingAdapter.h"
12
13
13
14
// TODO: Hardcode your wifi credentials here (and keep it private)
14
15
const char * ssid = " public" ;
15
16
const char * password = " " ;
16
17
18
+ #if defined(LED_BUILTIN)
17
19
const int ledPin = LED_BUILTIN;
18
-
19
- #ifdef ESP32
20
- ESP32WebThingAdapter adapter (" esp32" );
21
- #endif
22
- #ifdef ESP8266
23
- ESP8266WebThingAdapter adapter (" esp8266" );
20
+ #else
21
+ const int ledPin = 13 ; // manully configure LED pin
24
22
#endif
25
23
24
+ WebThingAdapter adapter (" w25" );
25
+
26
26
ThingDevice led (" led" , " Built-in LED" , " onOffSwitch" );
27
27
28
28
ThingProperty ledOn (" on" , " " , BOOLEAN);
@@ -37,7 +37,9 @@ void setup(void){
37
37
Serial.print (" Connecting to \" " );
38
38
Serial.print (ssid);
39
39
Serial.println (" \" " );
40
+ #if defined(ESP8266) || defined(ESP32)
40
41
WiFi.mode (WIFI_STA);
42
+ #endif
41
43
WiFi.begin (ssid, password);
42
44
Serial.println (" " );
43
45
You can’t perform that action at this time.
0 commit comments