有興趣探索『GoPiGo』韌體與軟體 I2C 界面細節者,可以參考
《W!o+ 的《小伶鼬工坊演義》︰ 一窺全豹之系統設計《實驗》》
# This is the address for the GoPiGo
address = 0x08
debug=0
文本序列同時並行。
此處我們稍稍瀏覽
Python Programming API Functions:
Below is a more detailed description of the functions available with the GoPiGo with Python along with the usage and examples.
Click on the individual links below for more detail on their usage.
Motor control functions:
- fwd(): Move the GoPiGo forward with PID (better control)
- motor_fwd(): Move the GoPiGo forward without PID
- bwd(): Move the GoPiGo back with PID (better control)
- motor_bwd(): Move the GoPiGo back without PID
- left(): Turn GoPiGo Left slow (one motor off, better control)
- left_rot(): Rotate GoPiGo left in same position (both motors moving in the opposite direction)
- right(): Turn GoPiGo right slow (one motor off, better control)
- right_rot(): Rotate GoPiGo right in same position both motors moving in the opposite direction)
- stop(): Stop the GoPiGo
Motor speed Functions:
- increase_speed(): Increase the speed of the GoPiGo by 10
- decrease_speed(): Decrease the speed of the GoPiGo by 10
- set_left_speed(): Set speed of the left motor
- set_right_speed(): Set speed of the right motor
- set_speed(): Set speeds of both the motors
Encoder Functions:
- enc_tgt(): Set encoder target to move the GoPiGo to a set distance
- enable_encoders(): Enable the encoders
- disable_encoders(): Disable the encoders
Ultrasonic ranger read:
- us_dist(): Read distance from the ultrasonic sensor
LED control:
Servo control:
- enable_servo(): Enables the servo
- disable_servo(): Disables the servo
- servo(): Set servo position
Status from the GoPiGo:
- volt(): Read battery voltage in V
- fw_ver(): Get the firmware version of the GoPiGo
- enable_com_timeout(): Enable communication time-out(stop the motors if no command received in the specified time-out)
- disable_com_timeout(): Disable communication time-out
- read_status(): Read the status register on the GoPiGo
- read_enc_status(): Read encoder status
- read_timeout_status(): Read timeout status
Have a question or a suggestion? Go check out our support page here or post it on the forums here.
然後請讀者或設定好 WiFi ,或者安裝成 AP ,總之使『GoPiGo』的『網路連線』開始自由起來,如是『小汽車』行動方可無礙矣。
挺進軟體應用主題也☆