Problems using Arduino to upload games

Hi All,

I just received my Arduboy today. I have 0 experience in coding and was following the quickstart guide to install my Arduino to try to upload games into my Arduboy.

I installed all the libraries via the manager as suggested and picked Arduino Leonardo as the board. I picked the right port when connected the device and even ran a test for it (Hello world from Arduboy 2). It all went well until when I try to upload a game to the device. I chose the .ino file in the default folder (via sketchbook) and when I hit ‘upload’ button, error messages showed up as below:

Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: “Arduino Leonardo”

Build options changed, rebuilding all
C:\Users\wanya\AppData\Local\Temp\cc2ptrTe.ltrans0.ltrans.o: In function `main’:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to `setup’

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/main.cpp:46: undefined reference to `loop’

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino Leonardo.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Can anyone please let me know if I did anything wrong? Thank you so much!

That’s kind of a strange error it seems like there was an issue with the linking process for some reason?

There is something wrong with that ino, it has to have setup() and loop() inside. Try loading something from File / Examples / Arduboy2 /

1 Like

@eried’s right, those error messages probably mean there’s no setup or loop in the .ino file.

Post the ino file code so we know which one you mean and we’ll tell be able to tell why it isn’t working.

Otherwise, try using this hello world demo code:

#include <Arduboy2.h>

Arduboy2 arduboy;

void setup(void)
{
  arduboy.begin();
}

void loop(void)
{
 if(!arduboy.nextFrame())
  return;

 arduboy.pollButtons();

 arduboy.clear();
 arduboy.println("Hello World!");
 arduboy.display();
}

I think what is happened is that you unzipped the source into a folder and it contain multiple .ino files. you clicked one of them Arduino prompted you with a message that the .ino file needs to be in a folder and asked if you want to create and move it into that folder and you chose yes.

The Arduino IDE then moves that single file into the folder. When you try to upload it, it will fail because all the other files are missing.

What you should do after you unpack a source is change the name of that folder to the name of one of the .ino files (but without the .ino extension). For example when you unpack Dark-And-Under-master.zip you need to name the unpacked folder to Dark-And-Under Then you can click any .ino file in that folder to open the sketch and upload it.