Go Down

Topic: Can code for uno be adjusted to work with leonardo (Read 178 times) previous topic - next topic

Cakemom

Good morning

I am a custom cake artist/pastry chef by profession. I am making a BB8 grooms cake for a wedding on May 4th. The bride requested for the cake to be on a remote control base so she can "drive" the cake into the ballroom as a surprise for her groom. I agreed assuming finding a remote control platform to affix the wood cake board to just before the reveal would be relatively easy. I could not have been more wrong. I have been researching for months and have settled on needing to make a robot chassis with arduino controlled by bluetooth. I purchased all that I thought I needed and found a great tutorial that seemed quite straight forward. My concern has always been relying on the code I find being correct as I have no experience in this arena. Sadly that fear seems to be validated. I made the mistake of buying an arduino leonardo board and the code is for an uno or mega. I tried uploading it but it failed, getting a void setup error. Is this because the board is not the same? Is there a way to adjust code so that it will work for a leonardo board? 

Please forgive my ignorance if anything i've said doesn't make sense. I am grateful for any help that can be provided.


Geek Emeritus

google "leonardo pinout" and print a copy
google "UNO pinout" and print a copy

where the code has values like MISO & MOSI and Serial, you will see that both boards have pins with the same labels, but different pin numbers on different boards. the first thing to do is identify all of those and use the pin numbers you need for your Leonardo, not the pin numbers you would need for the UNO or MEGA

getting the code up and running by May 4th - good luck with that.
All PMs will be deleted unopened due to arrogant argumentative pot stirring Malfoys.
 If you have not read "How to use this forum - please read", in particular: "7. If you are posting code or error messages, use "code" tags":  expect rude responses

pert

I tried uploading it but it failed, getting a void setup error. Is this because the board is not the same?
There's no such thing as a "void setup" error. Being vague like that is not conducive to you getting help with your problem.

Please do this:
  • When you encounter an error, you'll see a button on the right side of the orange bar "Copy error messages" in the Arduino IDE (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button..
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the error between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.


If the text exceeds the forum's 9000 character limit, save it to a .txt file and podst it as an attachment. If you click the "Reply" button here, you will see an "Attachments and other settings" link.

Go Up