0
Your shopping cart is empty!

PicoBorg - Examples

Posted by in Build, PicoBorg - Build on October 19, 2017 . 0 Comments.

Main Examples

Download instructions here.

4dc.py

This is a simple terminal script for providing user toggling of the 4 drives.
It uses the rpi.gpio library for commanding the GPIO pins and a simple interface which allows you to type which drives to toggle, allowing you to toggle more than one at the same time.

stepper.py

Another terminal script, this time controlling a 6 wire stepper motor, connected as explained on the specification page.
This script requires two lines to be correct for the stepper connected, stepdelay is the number of seconds between step the motor can handle (line 18) and sequence is the order in which the drive signals need to be turned on to cause forward rotation (line 17).
The sequencing will turn off a drive and turn the drive 2 places higher on in the same step, meaning two drives are enabled at any given step.
Finally when run you specify how many steps to move (direction with +/-) and it will move as fast as the stepdelay specifies.

stepper_seq.py

Slightly more advanced version of stepper.py, this script gains two things.
Firstly we gain a moveangle function, worked out by the degperstep value (line 19) which tells the script how many degrees a single step rotates the motor (this is motor specific).
Secondly we now have a sequence with controls the stepper written in terms of angular movements, this illustrates different move types in one script.

4dc_gui.py

The most complex of the main examples, this script is mostly a GUI dialog added to the 4dc.py script with a major difference, it is now using wiringpi.
The move to wiringpi is for two reasons, firstly it shows how the other scripts could be happily written with either rpi.gpio or wiringpi, secondly it provides access to the PWM control for drive 2.
This script demonstrates how to make a very simple GUI with interactive controls, message boxes and the operation of the PWM function, the GUI is written for Tk.

Bash

Menu

More advanced script which provides a user menu and responds to key presses.
Demonstrates both reading and writing with the device.
To get and run this script type the following into a terminal:

cd ~
wget -O menu.sh https://www.piborg.org/downloads/picoborg/menu.sh.txt
chmod +x menu.sh
~/menu.sh

Manually download script here: https://www.piborg.org/downloads/picoborg/menu.sh.txt

user examples

Please post any examples you would like to share with others here on the forum.

Last update: October 27, 2017

Comments

Leave a Comment

Leave a Reply

* Name:
* E-mail: (Not Published)
   Website: (Site url with http://)
* Comment:
Verification code: