Need support?
129
Chapter 4 Robot Dog
█
www.freenove.com
attitude(r,p,y)
Set roll, pitch, and yaw angle of the robot.
IMU.py
Function
Description
imuUpdate()
Update the current roll, pitch, and yaw angle of the robot.
Led.py
Function
Description
ledIndex( Index, R, G, B)
Turn on one LED and set color.
wheel(pos)
Create different RGB values.
LED_TYPR(order,R_G_B)
Change the order in which the LED color data is transmitted. When
the value of the order parameter is
"RGB", the order of data transmission should be: R-G-B; when the
value of the order parameter is "GBR",
and the order of data transmission should be: G-B-R
theaterChaseRainbow(strip,
wait_ms)
The function is used to make 7 LEDs show one color at the same time,
and change various colors to blink.
The blinking interval is wait_ms, and the default value is 50ms
rainbow(strip, wait_ms)
This function achieves the effect of rainbow breathing. It makes 8
LEDs display same color at the same
time, and then change all various colors like breathing. The interval is
wait_ms. The default value is 20ms.
rainbowCycle(strip, wait_ms)
This function also achieves the effect of rainbow breathing. but unlike
rainbow(), it makes eight LEDs to display different colors at the same
time, and then change various color separately. The interval is
wait_ms.
The default value is 20ms
Servo.py
Function
Description
setServoAngle(channel, angle)
Turn the servo of the specified channel to specified angle.
Ultrasonic.py
Function
Description
getDistance()
Obtain the distance between the obstacle in front and the ultrasound.
Summary of Contents for Raspberry Pi 2 Model B
Page 35: ...Need support support freenove com 33 Chapter 0 Raspberry Pi Preparation www freenove com ...
Page 71: ...Need support support freenove com 69 Chapter 2 Assemble Robot www freenove com M3 Nut M3x12 ...
Page 98: ...Need support support freenove com 96 Chapter 4 Robot Dog www freenove com ...