ScratchGPIO support for MotorPiTx

This board makes it very easy to control Motors and Servos without any extra hardware as well as giving you the ability to switch your Raspberry Pi on and off and power it from AA batteries. See xxxx for further info on all its capabilities. This section is about controlling and using it with Scratch.

MotorPiTxIf you’ve got one of these then just create a variable called AddOn and set it to MotorPiTx as the first line in your Green Flag your Green Flag event.

MotorPiTxUpDownThese show you how to use the variables Motor1 and Motor2 to make a vehicle go forwards or backwards with the arrow keys

Servo control is done through variables Servo1 and Servo2 (or you can use Tilt or Pan instead).

The servo1 accepts values from -60 to +60 degrees (to avoid jamming issues if used as a tilt servo) and servo2 accepts -90 to 90

If Ultrasonics are connected to inputs 1 or 2 as per then they are reffered to as Ultra1 or Ultra2

PiRoCon from 4tronix

pirocon1Draft information

The PiRoCon from 4tronix is a robot vehicle controller board with direct support for 2 bi-directional motors, 2 servos, an Ultrasonic Module and 8 input/outputs that can handle 5V and 3.3V devices so its very useful for just plug and play robotics 🙂

As well as the above, you can plug an additional expansion module – the Adafruit 16 channel PWM/Servo Board into it and control those outputs as well.

The script on the left shows the variables that it responds to

Tilt can be from -70 to 80, Pan from -90 to 90, MotorA/B from -100 to 100.

Setting Tilt or Pan to off is available to help extend battery running time and the servos will just stay in there last position.

The Ulrasonic support input is exactly the same  as previously documented except no need to wire any resistors as the PiRoCon board does that for you 🙂

If you plug in the Adafruit board, then the pins can be reffered to as Servo1 to Servo16 or Power1 to Power16 if just needing normal PWM outputs for driving motors(thru extra buffer electronics) or direcly varying LED brightness