First Plugin and Code Upload


Walkthrough Video

Watch the video to see how to connect Code Lab so you can upload your first program!

Code

The code in the editor below is ready to run! After you have plugged in Code Lab and have a green power light, hit 'Upload Your Code' and the red LED of Code Lab should start blinking really quickly, plus you'll see 'Success!' pop up on the code editor.


/* Blink Code Lab's red LED light on and off 10 times per second */ void setup(){ pinMode(2,OUTPUT); //Set pin 2 to receive power } void loop(){ digitalWrite(2,HIGH); //Turn on pin 2 delay(50); //Wait 50 milliseconds (0.05 seconds) digitalWrite(2,LOW); //Turn off pin 2 delay(50); //Wait 50 milliseconds (0.05 seconds) }
 

Challenges

Can you complete the challenge? Change the code in your code editor above. Upload your code to see the effect when you're finished. Complete a challenge? Check it off the list!

Concepts

These are the new code concepts covered in this example program. To become a great coder, read through these concepts to learn new vocabulary.

Quiz

If you're having trouble, try to run an experimental program or look at the example code to help you find the answer.

1. Which syntax ends the entire 'void loop' function?




2. Which syntax ends a single code command?



Subscribe to Launchpad emails

Get resources and tips over the next couple of weeks as you get started with your kit!

Which coding kit(s) do you have?*

Having trouble uploading code? Try these steps in order:

1) Make sure you’ve completed the process at www.letsstartcoding.com/start. There are helpful steps there!

2) Make sure your board is plugged in snugly. You should see a steady green light on your board when it it powered on.

3) Try plugging your cable into a different USB port on your computer. If that fixes it, it doesn't mean the first USB port is broken, it may just be that your board didn't establish a connection with your computer the first time.

4) Unplug other USB devices from your computer to ensure nothing is interfering with the connection.

5) If this is your very first time using your kit, you may need to restart your computer after setting everything up, especially if you manually installed drivers on a Windows computer.

Still having trouble? Send us an email at info@letsstartcoding.com with the subject line: First Upload Problem: Code Lab.
Please describe what type of computer you're using and what happened when you tried each step above. We can help!