Arduino Exercises

Blink!

Time to make our first program!

Start Arduino.

Go to the file menu and select (->) Examples -> 0.1 Basics -> Blink

Take a look at the code.

What do you think it will do?

Select tools -> Board -> Heltec ESP32 Series Dev-Boards -> WiFi Lora 32(v2).

Select tools -> LoRaWan Region -> REGION_US915.

Select tools -> Upload Speed -> 921600

Look at tools -> Port -> serial ports… and try to remember the list… Now plug in the Heltech LoRa 32 board via micro-USB connector. Go back to tools -> Port -> serial ports… and see if you can identify the new one that should have appeared. Select the new one that appeared! On Windows 10, it is probably a COM port >50. If you don’t see a new COM port listed, click out of the menu, unplug, pause, re-plug, and try again.

Fingers crossed… click on the right pointing arrow ("upload") – with a little luck, you will see some messages about compiling, uploading,… and then you should see your program run!

I have noticed some quirks in Arduino V2. E.g. not able to make a new example if you select a board first, and it’s not connected.

Task

Change how fast the LED is blinking!

Show Me A Letter!

Next example to look at: file -> examples -> 0.4 Communications -> ASCIITable.

Take a look at the code.

What speed do you think it’s going to be communicating at?

Make sure you select the correct board type, and port.

Upload this example.

As soon as it finishes uploading, it will run… and you’ll probably miss the results!

So now that the program is uploaded, start the serial monitor. It’s the magnifying glass over a sequence of dots, on the right of the tool bar.

Make sure it has the right speed (baud rate).

Press the rst (reset) button on the Heltech board.

What do you see in the serial monitor?

Pictures!

Try one of the examples under file -> examples -> Heltech-Example -> OLED -> SSD1306_I2C.

Upload and observe.

Challenge Time!

Go back to the blink example.

Upload it and check it is working.

Look at the ASCIITable example.

Figure out what code to copy from the ASCIITable program to output a message every time the LED is turned on (and/or off.)

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top