77
88 The following variables are automatically generated and updated when changes are made to the Thing properties
99
10- bool Switch ;
10+ bool switchButton ;
1111
1212 Properties which are marked as READ/WRITE in the Cloud Thing will also have functions
1313 which are called when their values are changed from the Dashboard.
@@ -26,7 +26,7 @@ void setup() {
2626 initProperties ();
2727
2828 // Connect to Arduino IoT Cloud
29- ArduinoCloud.begin (ArduinoIoTPreferredConnection, " mqtts-sa.iot.oniudra.cc " );
29+ ArduinoCloud.begin (ArduinoIoTPreferredConnection);
3030
3131 /*
3232 The following function allows you to obtain more information
@@ -49,29 +49,29 @@ void loop() {
4949 ArduinoCloud.update ();
5050 // Your code here
5151
52- Switch = !Switch ;
53- if (Switch ) {
54- Loc = { . lat = latMov, . lon = lonMov } ;
55- Color = { . hue = hueRed, . sat = satRed, . bri = briRed } ;
52+ switchButton = !switchButton ;
53+ if (switchButton ) {
54+ location = Location ( latMov, lonMov) ;
55+ color = Color ( hueRed, satRed, briRed) ;
5656 } else {
57- Loc = { . lat = latArd, . lon = lonArd } ;
58- Color = { . hue = hueGreen, . sat = satGreen, . bri = briGreen } ;
57+ location = Location ( latArd, lonArd) ;
58+ color = Color ( hueGreen, satGreen, briGreen) ;
5959 }
6060 delay (5000 );
6161}
6262
6363
64- void onSwitchChange () {
64+ void onSwitchButtonChange () {
6565 // Do something
66- digitalWrite (LED_BUILTIN, Switch );
66+ digitalWrite (LED_BUILTIN, switchButton );
6767}
6868
6969void onColorChange () {
7070 // Do something
7171 Serial.print (" Hue = " );
72- Serial.println (Color .getValue ().hue );
72+ Serial.println (color .getValue ().hue );
7373 Serial.print (" Sat = " );
74- Serial.println (Color .getValue ().sat );
74+ Serial.println (color .getValue ().sat );
7575 Serial.print (" Bri = " );
76- Serial.println (Color .getValue ().bri );
76+ Serial.println (color .getValue ().bri );
7777}
0 commit comments