Skip to content

Introduction to the basics of programming hardware using the Viam Python SDK by making an LED blink.

License

Notifications You must be signed in to change notification settings

JessamyT/LED-Blink

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LED-Blink

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.

A GIF of the completed project showing a blinking blue LED connected to a Raspberry Pi with jumper cables.

Circuit Diagram

For reference, the circuit you are building for this tutorial looks like this:

Circuit diagram showing a Raspberry Pi with a red connector running out of GPIO pin 8 to a 100-ohm* resistor*. The resistor is connected to the long lead of a red LED bulb. Finally, a blue connector connects the short lead of the LED to the ground connection on pin 6 of the Raspberry Pi GPIO pins.

Prerequisites

You will need the following hardware, tools, and software to complete this project:

Hardware

Software

Installation

  1. Install Viam Server on your Raspberry Pi.

  2. Clone this repo onto your development machine:

git clone [email protected]:viam-labs/LED-Blink.git

Python

  1. Install Viam Python SDK on your computer.

  2. Update the payload and address information in blink.py. You can your information from the Connect tab of the Viam App.

  3. Run your code!

python3 python/blink.py

Go

  1. Install Viam Go SDK on your computer.

  2. Update the payload and address information in blink.go. You can your information from the Connect tab of the Viam App.

  3. Run your code!

go run go/blink.go

Contributing TLDR

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

About

Introduction to the basics of programming hardware using the Viam Python SDK by making an LED blink.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 54.6%
  • Python 45.4%