mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-10-29 17:50:37 +00:00
13 lines
264 B
Python
13 lines
264 B
Python
from gpiozero import Robot, MCP3008
|
|
from gpiozero.tools import scaled
|
|
from signal import pause
|
|
|
|
robot = Robot(left=(4, 14), right=(17, 18))
|
|
|
|
left = MCP3008(0)
|
|
right = MCP3008(1)
|
|
|
|
robot.source = zip(scaled(left.values, -1, 1), scaled(right.values, -1, 1))
|
|
|
|
pause()
|