DenScript Uno Kit Lesson 2: The First Program

Downloading the Software

To program the DenScript Uno, we need to download the Arduino IDE. This is a piece of software, available on Windows and Mac, that will allow you to write code we will upload onto the DenScript Uno. To start with, go to https://www.arduino.cc/en/main/software and follow the instructions to download the software. Once you have opened the software, you will be greeted with this screen.

Programming

Copy this code out.

This code will cause the LED to toggle its state once a second.

Lets go through this code one bit at a time.

‘ int led = 13 ‘: will assign the integer value of 13 to the variable ‘led’.

In the ‘setup()’ function, we set the led pin to the output state.

Finally, in the ‘loop()’ function, we set the led pin HIGH (which means on), delay by 1000 milliseconds (1 second), set the led pin LOW (which means off), and then delay another 1000 milliseconds. As this all happens in the ‘loop()’ function, it repeats indefinitely.

To upload the code to the DenScript Uno, plug your DenScript Uno into your computer using the USB cable. Then go to Tools > Port and select an available serial port. This should be the DenScript Uno. If this is your first time connecting the DenScript Uno to the computer, you may need to install a driver. Once you have selected the port, click the upload button (it looks like an arrow below the ‘Edit’ menu).

On the DenScript Uno, Digital Pin 13 is connected to LED4. Whilst uploading the program LED1 and LED2 should be flashing. Once the program is uploaded, LED4 should start flashing at a rate of once a second.

Troubleshooting

If you are unable to upload your program, make sure the DenScript Uno has its power select jumper set to ‘VUSB’. If this is correct LED3 will be lit.

If there are issues selecting the DenScript Uno as the Serial Port in the Arduino IDE, it may be because your computer will need time to detect the DenScript Uno and set it up for first use.

All DenScript products have been tested before being shipped and any defunct units would be withheld. Therefore, we can not take responsibility if you break your unit.