Advertisement
zhexo

MKR_test_board_code

Feb 6th, 2023 (edited)
1,146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "thingProperties.h"
  2. const int buttonPin = 7;
  3.  
  4. void setup() {
  5.   Serial.begin(9600);
  6.   delay(1500);
  7.  
  8.   initProperties();
  9.   ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  10.   setDebugMessageLevel(2);
  11.   ArduinoCloud.printDebugInfo();
  12.  
  13.   pinMode(LED_BUILTIN, OUTPUT);
  14.   pinMode(buttonPin, INPUT);  
  15. }
  16.  
  17. void loop() {
  18.   ArduinoCloud.update();
  19.   buttonState = digitalRead(buttonPin);
  20.   digitalWrite(LED_BUILTIN, ledState);
  21.  
  22. }
  23.  
  24. void onButtonStateChange()  {
  25.   // Add your code here to act upon ButtonState change
  26. }
  27.  
  28. void onLedStateChange()  {
  29.   // Add your code here to act upon LedState change
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement