Robot Kit
Project description
robot_kit
Having fun with the Freenove 4WD Smart Car Kit
Install
SSH to your Raspberry Pi and install the Python module for Python 3.
$ sudo pip3 install robot_kit
Examples
See the Examples directory for all the code, here is the code listing for examples/robot_start.py
from robot_kit.leds import NeoPixelStrip
from robot_kit.wheels import Wheels
from robot_kit.ultrasonic import Ultrasonic
import time
if __name__ == '__main__':
"""Run some of the basic commands for robot_kit"""
"""Test for the NeoPixelStrip class"""
led_strip = NeoPixelStrip()
# Turn the LEDs Yellow and then Green
led_strip.on(128, 128, 0)
time.sleep(1.0)
led_strip.on(0, 255, 0)
time.sleep(1.0)
led_strip.off()
# Turn the wheels
wheels = Wheels()
wheels.all(0.25)
time.sleep(1.0)
wheels.stop()
# Get the distance from the Ultrasonic sensor
dis_sensor = Ultrasonic()
for i in range(50):
print(dis_sensor.get_distance())
time.sleep(0.5)
Note: Yon order to run this code you'll need to be sudo as the LED library requires it.
$ sudo python3 robot_start.py
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
robot_kit-0.1.4.tar.gz
(6.5 kB
view hashes)
Built Distribution
Close
Hashes for robot_kit-0.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21e6ea947619ccb3c9e6194e7cad0e7a68f51824451e819b0b6e8768e0cfcbd8 |
|
MD5 | 459c59145315a979039967bb7045b392 |
|
BLAKE2b-256 | 98b0ff4ba47e6db49f70aa352f17aff622bcefc70760d17c8ef3eecc22146bf7 |