Getting this compile error when trying to upload Puzzle Box to a Nano RP2040 Connect.
/tmp/46136108/Puzzle_Box_mar21b/Puzzle_Box_mar21b.ino: In function 'void loop()': /tmp/46136108/Puzzle_Box_mar21b/Puzzle_Box_mar21b.ino:70:4: error: 'playMelody' was not declared in this scope playMelody(); ^~~~~~~~~~ /tmp/46136108/Puzzle_Box_mar21b/Puzzle_Box_mar21b.ino:70:4: note: suggested alternative: 'Melody' playMelody(); ^~~~~~~~~~ Melody Multiple libraries were found for "SPI.h" Used: /home/builder/.arduino15/packages/arduino/hardware/mbed_nano/4.1.1/libraries/SPI Not used: /home/builder/opt/libraries/eventethernet_1_0_0 Multiple libraries were found for "WiFiNINA.h" Used: /home/builder/opt/libraries/wifinina_1_8_14 Not used: /home/builder/opt/libraries/vega_wifinina_1_0_1 Multiple libraries were found for "Wire.h" Used: /home/builder/.arduino15/packages/arduino/hardware/mbed_nano/4.1.1/libraries/Wire Not used: /home/builder/opt/libraries/flexwire_1_2_0 Multiple libraries were found for "ECCX08.h" Used: /home/builder/opt/libraries/arduinoeccx08_1_3_8 Not used: /home/builder/opt/libraries/rak5814_atecc608a_1_0_0 Multiple libraries were found for "Servo.h" Used: /home/builder/opt/libraries/servo_1_2_1 Not used: /home/builder/opt/libraries/microbitv2_hhs_0_1_6 Not used: /home/builder/opt/libraries/printoo_library_1_0_2 Not used: /home/builder/opt/libraries/evive_2_0_3 Not used: /home/builder/opt/libraries/esp32_esp32s2_analogwrite_5_0_2 Not used: /home/builder/opt/libraries/servoesp32fix_1_1_2 Not used: /home/builder/opt/libraries/rokitsmart_1_0_9 Not used: /home/builder/opt/libraries/xmc_servo_1_0_1 Not used: /home/builder/opt/libraries/vovagorodok_servo_1_0_0 Not used: /home/builder/opt/libraries/servoesp32_1_1_1 Error during build: exit status 1
The cloud recognizes my board to, goes to the next step to load the templet and kicks it out.
Hi @ruiz6809. I apologize for the problem with the "Puzzle Box" template. This is caused by a bug in the template. The bug has been reported to the template developers. For now, you will need to create the project manually instead of using the template. I'll provide instructions you can follow to do that:
Create Circuit
Wire up the circuit as shown in the "Puzzle Box" tutorial:
I encountered a problem while I was doing this. I don't own the Arduino IoT Bundle, so it might have only been that the display I happen to have on hand is different from the one included in the bundle, but I found that the pinout of the display I have (which is the common "1602" display module) did not match with the pinout shown in the diagram in the tutorial. So double-check to make sure your connections match this table:
Click the following link to open the Arduino Cloud home page in your web browser: https://app.arduino.cc
Click the "CREATE NEW" button.
A menu will expand.
Select "Thing" from the menu.
The "Setup" page for a new Arduino Cloud Thing will open.
The Thing will have a generic default name (e.g., "Untitled 2"). It will be helpful to give it a better name. Click the thing name you see near the top left corner of the page.
A menu will expand.
Select "Rename" from the menu.
The "Rename Thing" dialog will open.
Type PuzzleBox in the "Name" field of the dialog.
Click the "RENAME" button.
The "Rename Thing" dialog will close.
Click the "ADD" button under the "Cloud Variables" section of the page.
The "Add variable" dialog will open.
Type display in the "Name" field of the dialog.
Click on the "Select variable type" menu.
The menu will expand.
Select "Character String" from the menu.
Click the "ADD VARIABLE" button.
The "Add variable" dialog will close.
Click the "ADD" button under the "Cloud Variables" section of the page.
Type sliderOne in the "Name" field of the dialog.
Select "Integer Number" from the "Select variable type" menu.
Click the "ADD VARIABLE" button.
Type sliderTwo in the "Name" field of the dialog.
Select "Integer Number" from the "Select variable type" menu.
Click the "ADD VARIABLE" button.
Type sliderThree in the "Name" field of the dialog.
Select "Integer Number" from the "Select variable type" menu.
Click the "ADD VARIABLE" button.
Click the "Select Device" button under the "Associated Device" section of the page.
The "Associate device" dialog will open.
If you have already created an Arduino Cloud Device for your Nano RP2040 Connect board, select it from the dialog. Otherwise, click the "SET UP NEW DEVICE" button at the bottom of the dialog and complete the device creation process.
Click the "Configure" button under the "Network" section of the Thing page.
The "Configure network" dialog will open.
Type the SSID of your Wi-Fi router's 2.4 GHz access point in the "Wi-Fi Name" field.
Type the password of your Wi-Fi access point in the "Password" field.
Click the "SAVE" button.
The "Configure network" dialog will close.
Create Dashboard
Click the icon at the top left corner of the page.
A navigation menu will open.
Select "Dashboards" from the menu.
The "Dashboards" page will open.
Click the "+ DASHBOARD" button.
A new dashboard page will open.
The dashboard will have a generic default name (e.g., "Untitled 2"). It will be helpful to give it a better name. Click the dashboard name you see near the top left corner of the page.
A menu will expand.
Select "Rename" from the menu.
The "Rename Dashboard" dialog will open.
Type PuzzleBox in the "Name" field of the dialog.
Click the "RENAME" button.
The "Rename Dashboard" dialog will close.
Click the "ADD" button near the top left corner of the page.
A menu will expand.
Select "Slider" from the menu.
A "Widget Settings" dialog will open.
Type Slider One in the "Name" field of the dialog.
Click the "Link Variable" button.
The "Link Variable to Slider One" dialog will open.
Select "PuzzleBox" from the list of Things under the left column of the dialog.
Select "sliderOne" from the list of Variables under the middle column of the dialog
Click the "LINK VARIABLE" button.
You will be returned to the "Widget Settings" dialog.
Change the value of the "Max" field in the dialog to 9.
Click the "DONE" button.
A "Widget Settings" dialog will close.
Click the "ADD" button near the top left corner of the page.
Select "Slider" from the menu.
Type Slider Two in the "Name" field of the dialog.
Click the "Link Variable" button.
Select "PuzzleBox" from the list of Things under the left column of the dialog.
Select "sliderTwo" from the list of Variables under the middle column of the dialog
Click the "LINK VARIABLE" button.
Change the value of the "Max" field in the dialog to 9.
Click the "DONE" button.
Click the "ADD" button near the top left corner of the page.
Select "Slider" from the menu.
Type Slider Three in the "Name" field of the dialog.
Click the "Link Variable" button.
Select "PuzzleBox" from the list of Things under the left column of the dialog.
Select "sliderThree" from the list of Variables under the middle column of the dialog
Click the "LINK VARIABLE" button.
Change the value of the "Max" field in the dialog to 9.
Click the "DONE" button.
Click the icon that looks like an eye near the top left corner of the page.
This will put the dashboard into display mode, where the layout and widgets are no longer editable. If you later want do make changes to the dashboard, you can click the icon that looks like a pencil next to the eye icon to enable editing again.
Create Thing Sketch
When you create a Thing, a skeleton sketch is automatically generated, to which you can add the code for how you want the Thing program to work. However, in this case the code is already provided in the tutorial so it is only necessary to replace the generated code with the code from the tutorial.
Click the icon at the top left corner of the page.
A navigation menu will open.
Select "Things" from the menu.
The "Things" page will open.
Click on the "PuzzleBox" Thing.
The "Setup" page for the Thing will open.
Click the "Sketch" tab.
The Arduino Cloud Thing sketch editor will open.
Click the "Open full editor" button.
The sketch will open in Arduino Cloud Editor.
Select the "PuzzleBox_rp2040.ino" tab in the code box.
Click on the code in the code box.
Press the Ctrl+A keyboard shortcut (Command+A for macOS users).
This will select all the code.
Press the Ctrl+C keyboard shortcut (Command+C for macOS users).
This will copy the selected code to the clipboard.
Switch back to the browser tab that has the Thing sketch open in Arduino Cloud Editor.
Click on the sketch code in Cloud Editor.
Press the Ctrl+A keyboard shortcut (Command+A for macOS users).
This will select all the generated skeleton code.
Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
This will replace the skeleton code with the tutorial code you copied in the previous step.
Switch back to the browser tab that has the tutorial open.
Select the "melody.h" tab in the code box.
Click on the code in the code box.
Press the Ctrl+A keyboard shortcut (Command+A for macOS users).
Press the Ctrl+C keyboard shortcut (Command+C for macOS users).
Switch back to the browser tab that has the Thing sketch open in Arduino Cloud Editor.
Click the + icon on the right side of the Cloud Editor tab bar.
A menu will expand.
Select "Add Header File .h" from the menu.
A new tab will be added to Cloud Editor, with the default name of "Untitled.h".
Rename the tab melody.h.
Click on the editor field in Cloud Editor.
Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
This will paste the tutorial code you copied in the previous step.
Upload Thing Sketch
Click the board selector on the Cloud Editor toolbar.
The "Select device" dialog will open.
Select the Nano RP2040 Connect board.
The "Select device" dialog will close.
Click the rightward pointing arrow button on the Cloud Editor toolbar.
Wait for the upload to finish successfully.
Click the "Serial Monitor" at the right side of the Cloud Editor toolbar.
A Serial Monitor browser window will open.
Some information will be printed to Serial Monitor to indicate the progress of connecting to the Wi-Fi access point and then to Arduino Cloud.
Wait until you see the "Connected to Arduino IoT Cloud" message in Serial Monitor.
You can now use the project as described in the tutorial:
Use the slider widgets on the "PuzzleBox" dashboard you created to configure the combination.
Use the potentiometers to match the combination and open the puzzle box.
The template does not work
Hi @ptillisch,I tried to build the box with cardboard, following the instructions in the template https://docs.arduino.cc/tutorials/iot-bundle/puzzlebox
I printed the pdf on sheets of paper, I cut out and recomposed the figure, glued the paper model on a cardboard and cut out the shape along the edges, however the box does not come out, some measurements seem wrong, in particular that of two lateral faces and of the support that should hold the Arduino board, the display, the servo and the LED. It would be useful to have a view inside the box, to understand where and how to position the various components