This project introduces 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.
Check out the full tutorial on the Viam documentation site.
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 git@github.com:viam-labs/LED-Blink.git
- Set up your Raspberry Pi and LED. See How to Make an LED Blink with a Raspberry Pi and the Viam SDK for details.
-
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. -
Change directory to the go directory.
cd go
- Run your code!
go run 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