The tilt_servo
and pan_servo
are within the pan_tilt
attribute, which is a PanTiltController(). Therefore, to access them you have to do it like this:
alex.pan_tilt.tilt_servo.target_angle = 64
alex.pan_tilt.pan_servo.target_angle = -10
If you call alex.pan_tilt.calibrate()
you will be taken through calibration of both servo motors, just make sure theyâre plugged into the correct ports on the Expansion Plate.
You can find the SDK on github, and our docs are here.
Please see this post to check if you have been impacted by an updater problem we recently found.
For Line Following, we also have a set of three tutorials on further.pi-top.com - you can find the first one here: https://further.pi-top.com/challenges/600be7f44d56f2001c1fd674
Finally, you can run everything in VS Code and if youâre running on the pi-top you should see details on the library. The one issue with this right now is the subclasses of the Pitop object (e.g. pan_tilt, drive, camera etc) are added at runtime when using the from_config
method so the IDE wonât know that they exist. However, you can just create a pan_tilt object by doing:
from pitop import PanTiltController
pan_tilt = PanTiltController()
and youâll be able to see all the information you need within an IDE. The from_config
method was created to conveniently build an entire robot encapsulated in one âPitopâ object, the downside being your IDE wonât know its subclasses exist because they are added dynamically when the program is run.
Hope this helps!