Mastoras Inc
Published © GPL3+

Smart Coaster With Arduino Nano 33 IoT

Introducing the Smart Coaster: Where Elegance Meets Innovation! Control LEDs seamlessly through Arduino Cloud for a cool DIY experience

IntermediateFull instructions provided4 hours290
Smart Coaster With Arduino Nano 33 IoT

Things used in this project

Hardware components

Arduino Nano 33 IoT
Arduino Nano 33 IoT
×1
9V battery (generic)
9V battery (generic)
×1
5 mm LED: Red
5 mm LED: Red
×8
5 mm LED: Green
5 mm LED: Green
×8
LED, Blue
LED, Blue
×8
High Brightness LED, White
High Brightness LED, White
×8
Pitch PCB Screw Terminal
×1

Software apps and online services

Arduino IoT Cloud
Arduino IoT Cloud

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Custom parts and enclosures

Case-Top

Case-Bottom

Schematics

PCB Schematic

Code

Code

Arduino
/*
  Sketch generated by the Arduino IoT Cloud Thing "Untitled"
  https://create.arduino.cc/cloud/things/bbedde4c-20e2-401e-9623-8edcb92f3ae2


  Arduino IoT Cloud Variables description


  The following variables are automatically generated and updated when changes are made to the Thing


  int lED1;
  int lED2;
  int lED3;
  int lED4;


  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/


int LED = 12;
int LED_2 = 11;
int LED_3 = 10;
int LED_4 = 16;
#include "thingProperties.h"



void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(1500);
  //pinMode(LED_2, OUTPUT);
  // Defined in thingProperties.h
  initProperties();


  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);



  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
  */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();


}


void loop() {

  ArduinoCloud.update();


  onLED1Change();
  onLED2Change();
  onLED3Change();
  onLED4Change();
}


/*
  Since LED1 is READ_WRITE variable, onLED1Change() is
  executed every time a new value is received from IoT Cloud.
*/
void onLED1Change()  {
  // Add your code here to act upon LED1 change
  analogWrite(LED, lED1);
}


/*
  Since LED2 is READ_WRITE variable, onLED2Change() is
  executed every time a new value is received from IoT Cloud.
*/
void onLED2Change()  {
  // Add your code here to act upon LED2 change


analogWrite(LED_2, lED2);
}


/*
  Since LED3 is READ_WRITE variable, onLED3Change() is
  executed every time a new value is received from IoT Cloud.
*/
void onLED3Change()  {
  // Add your code here to act upon LED3 change
  analogWrite(LED_3, lED3);
}


/*
  Since LED4 is READ_WRITE variable, onLED4Change() is
  executed every time a new value is received from IoT Cloud.
*/
void onLED4Change()  {
  // Add your code here to act upon LED4 change
  analogWrite(LED_4, lED4);
}

Credits

Mastoras Inc
4 projects • 1 follower
Contact

Comments

Please log in or sign up to comment.