https://github.com/sarat-ravi/python-picircuit
Raspberry Pi Hardware Hacking Made Easy
https://github.com/sarat-ravi/python-picircuit
Last synced: 4 months ago
JSON representation
Raspberry Pi Hardware Hacking Made Easy
- Host: GitHub
- URL: https://github.com/sarat-ravi/python-picircuit
- Owner: sarat-ravi
- Created: 2014-11-17T05:39:08.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-19T08:58:51.000Z (over 10 years ago)
- Last Synced: 2025-01-16T18:31:12.974Z (6 months ago)
- Language: Python
- Size: 156 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#Getting Started
picircuit is an abstraction to make hardware hacking with Raspberry Pi easy, by providing high-level APIs to interface with electrical components##Examples
The examples below show the code required to interact with components###Flashing LED
The following snippet of code starts a flashing led, waits for 10 seconds, and turns off the LED component```python
#!/usr/bin/env python
import sys
import time
from picircuit.components.led import FlashingLED
from RPi import GPIOdef main(args):
print "start"# Causes an LED on pin 12 to flash every 0.1 seconds
flashing = FlashingLED(pin=12, interval=0.1)# Turns on flashing LED, waits for 10 seconds, and turns off LED
flashing.on()
time.sleep(10)
flashing.off()print "done"
```###LCD Display
This snippet shows come code to write arbitrary text to LCD1602, which is a popular LCD display commonly used with Arduino and Raspberry Pi```python
#!/usr/bin/env python
import sys
import time
from picircuit.components.lcd import LCD1602
from RPi import GPIOdef main(args):
print "start"
# Create an LCD1602 display component
lcd = LCD1602(rs_pin=12, rw_pin=18)
lcd.on()# Prints arbitrary text data to LCD
lcd.text("Hello World!")
time.sleep(10)
lcd.text("Good Bye!")
lcd.off()print "done"
```