First Plugin and Upload: Sensor Trio Add-On

First Plugin and Code Upload: Sensor Trio Add-On


Walkthrough Video

Watch the video to see how to connect Code Lab Mini and attach any add-on boards you purchased so you can upload your first program!

Skip to 1:20 if you only need information about attaching an add-on board.

Code

The code in the editor below is ready to run! After you have attached your Add-On board, plugged in Code Lab Mini and have a steady power light on both your Code Lab Mini and your Add-On board, hit 'Upload Your Code' and after you see 'Success!' pop up on the code editor, a tone will start playing on the speaker. Move your hand closer or further from the light sensor to change the pitch you hear!

P.S. Don't worry about trying to understand this code just yet, that's what the projects are for.


/* Use the light sensor reading to determine what tone plays on the speaker You may need a flashlight to make this program work if you're in a dim room */ void setup() { pinMode(A2,INPUT); //light sensor pinMode(2,OUTPUT); //speaker } void loop() { tone(2,analogRead(A2)); //Use the light sensor reading (0-1023) as the hertz value for the speaker tone } // (c) 2023 Let's Start Coding. License: www.letsstartcoding.com/bsdlicense
 


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 Mini.
Please describe what type of computer you're using and what happened when you tried each step above. We can help!