Skip to content

Commit a18e27b

Browse files
committed
- Fix button callbacks according to v4 spec
1 parent 161238b commit a18e27b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/Benchmark/Benchmark.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ void setup() {
7373
bar.updateX(XAxis, 7);
7474

7575
/* Attach Button Callback */
76-
button.attachCallback([&](bool value){
76+
button.attachCallback([&](int value){
7777
/* Print our new button value received from dashboard */
78-
Serial.println("Button Triggered: "+String((value)?"true":"false"));
78+
Serial.println("Button Triggered: "+String((value == 1)?"true":"false"));
7979
/* Make sure we update our button's value and send update to dashboard */
8080
button.update(value);
8181
dashboard.sendUpdates();

examples/Interactive/Interactive.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ void setup() {
7171
Serial.println(WiFi.localIP());
7272

7373
/* Attach Button Callback */
74-
button.attachCallback([&](bool value){
74+
button.attachCallback([&](int value){
7575
/* Print our new button value received from dashboard */
76-
Serial.println("Button Triggered: "+String((value)?"true":"false"));
76+
Serial.println("Button Triggered: "+String((value == 1)?"true":"false"));
7777
/* Make sure we update our button's value and send update to dashboard */
7878
button.update(value);
7979
dashboard.sendUpdates();

0 commit comments

Comments
 (0)