In this post, you will be introduced to the basics of programming hardware using the Viam SDK by making an LED blink. This will allow you to write Python or Golang code to make an LED connected to the GPIO of a Raspberry Pi blink. This tutorial is a good introduction to Python programming, and developing code for hardware like robots and IoT devices.
For reference, the circuit you are building for this tutorial looks like this:
You will need the following hardware, tools, and software to complete this project:
-
- You will be using a 100 Ohms resistor, which is the resistor colored with brown-black-brown
-
Clone this repo onto your development machine:
git clone [email protected]:viam-labs/LED-Blink.git
-
Update the payload and address information in
blink.py
. You can your information from theConnect
tab of the Viam App. -
Run your code!
python3 python/blink.py
-
Update the payload and address information in
blink.go
. You can your information from theConnect
tab of the Viam App. -
Run your code!
go run go/blink.go
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D