Batmobile Arduino Uploading Code

After setting everything up, we can move on to uploading code to your Batmobile.

Choose what to upload

You can either write your own simple program or download one of the games from our Github repository to use as a starting point. 

Here's an example of a simple code you can upload:


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#include <Batmobile.h>

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

void loop(){
  Headlights.setSolid(255);
	delay(200);
	Headlights.setSolid(0);
	delay(200);
	Taillights.setSolid(255);
	delay(200);
	Taillights.setSolid(0);
	delay(200);
	Underlights.setSolid({80, 80, 80});
	delay(200);
	Underlights.setSolid({0, 0, 0});
}


Let's make sure your Batmobile is ready for the upload!

Turn on your Batmobile and plug it into your computer with a USB cable. 

Next, in Arduino go to Tools -> Port, and select the port your Batmobile is connected to. It’s usually the only option available.



Then, click the Upload button (arrow pointing to the right).


And that's it! You have now uploaded your code to the Batmobile. Great job!