A quick and easy introduction to how to use the RevPi with the Python programming language.
...
Python is simple and straightforward
Documentation
Start interactive Python shell
Code Block python3
My recommendation use uses the ipython IPython interactive shell as it supports tabbed auto completition
Code Block sudo apt install ipython3 ipython3
...
Info |
---|
We read out the offset of “Output_1” variable. This may vary on your configuration, so be careful here. |
Code Block | ||
---|---|---|
| ||
pi@RevPi40302:~ $ piTest -v Output_1 variable name: Output_1 offset: 43 length: 8 bit: 0 |
...
Library developed from the RevPi community
Allows easy use of symbolic names from PiCtory
Installation not necessary, already on the device
Documentation
...
Code Block | ||
---|---|---|
| ||
import revpimodio2
rpi = revpimodio2.RevPiModIO(autorefresh=True)
rpi.io.RevPiLED.value = 1
rpi.io.RevPiLED.value = 0
rpi.cleanup() |
Python I/O Bit Mirror
Code Block | ||
---|---|---|
| ||
import revpimodio2
import time
rpi = revpimodio2.RevPiModIO(autorefresh=True)
while True:
rpi.io.O_1.value = rpi.io.I_1.value
time.sleep(0.02)
revpi.cleanup() |
Video Tutorials
Also have , take a look at our video tutorials about Python
Also have Besides, take a look at the following video tutorials
...
Filter by label (Content by label) | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Page Properties | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
|