Skip to main content

Snake Setup

At this point we're ready to begin writing some code. Go ahead and open up your Arduino IDE that you downloaded in the Getting Started section and make sure that your microcontroller is connected to your computer.

Barebones Code#

We'll go ahead and name our code file snake.ino, and will refer to it as such through this tutorial. You can name it whatever you want.

You can go ahead and copy and paste the following code block into your file. It just sets up some basic constants and structure which will be useful to us while programming.

snake.ino
#define WIDTH 16#define HEIGHT 16#define NUM_LEDS WIDTH * HEIGHT
#define DATA_PIN 0#define joyX A0#define joyY A1
void setup() {
}
void loop() {
}

Setup FastLED Library#

drawing

This Content is Locked

Enter your GCA kit's access code to continue