The Pibrella from Cyntech/Pimoroni is a great add-on board for the Raspberry Pi which consists of 3 large LEDs (Red/Amber/Green), 4 digital inputs (A-D), 4 buffered outputs (E-F) with white LEDs to indicate their state, large switch and a Piezo speaker.
To use it, launch ScratchGPIO5 Plus and create a variable called AddOn and set its value to Pibrella in your On Green Flag event.
You can then use the usual AllOn/Off broadcasts and well as individual broadcasts for Red/Amber/Green/OutputE/OutputF/OutputG and OutputH
Also there is a special broadcast BeepXX where XX is the equivalent Scratch note value (60 being Middle C) The sound quality from a piezo is not the same as a large speaker so expect to be able to compose a top ten hit π
BeepXX,YY is also available where YY is note duration
The 4 inputs are recognised as sensor values InputA to D.Β These give “off” normally and “on” when activated.Β The switch is called “switch” and gives off and on.
To control the brightness of the LEDs use PowerRed/PowerAmber/PowerGreen
To control the power settings of the outputs, use PowerOutE to H.
You can connect up a low-cost 5pin stepper and connect it to the outputs (Red to any left hand one, the other 4 to the 4 right hand ones) and use a variable called Stepper to make it turn.
Note new addition – MotorE..H variable
TOPTIP – set a variable called Bright from 1 to 100 and your can control the brightness of the VERY bright LEDs π
Thanks for a really useful Scratch version. You have a couple of errors in the examples on this page: the variables for adjusting the brightness of the LEDs are ‘greenpower’ rather than ‘powergreen’ etc as shown. Similarly, the variables needed to adjust the output led brightness are ‘powerg’ rather than ‘poweroutputg’ etc
Hi Richard
The syntax for the Pibrella changed drastically between V4 and V5 to be more consistent.
So power is now a prefix for everything, powerred, powergreen, poweroutpute etc
And all the outputs were renamed as outpute.h and all the inputs inputa..d
At least I hope the documentation does match up correctly with ScratchGPIO5 π
regards
Simon
Hi Simon,
I have ScratchGPIO5 and I’m afraid the syntax is as I noted in my first comment. It is definitely ‘AmberPower’ rather than ‘poweramber’. This is as defined in scratchgpio_handler5.py: cLed = [[“redpower”,13],[“amberpower”,11],[“greenpower”,7]]
So I’m afraid that there is an inconsistency/mismatch somewhere… π¦
cheers
Richard
mm – I’m hoping you just downloaded V5 before I did the change as its not like that now in either my copy of dev or the stable release. Could you re-download for me please and re-install (won’t affect any existing projects in the Documents folder)
Simon
Any further feedback?
Yep you were right. I download ScratchGPIO5 again and it works as described on this page. Thanks again for a great library! Any plans to add support for the Pi_Lite boards?
Phew :). I’ll see if they’ll send me one up to add it in π
Great stuff thanks, any ideas in what would be good to make. Hat shake?
What’s hatshake?
Hi,
I would like to translate this page to support our French/Belgian users with PiBrella + ScratchGPIO5 ?
Translation will be inserted in the following tutorial:
http://mchobby.be/wiki/index.php?title=PiBrella
Would you be open to surch translation effort?
Kind regards,
Dominique
MCHobby.be
Ne pas de probleme et merci π
Hi,
Thank the autorization.
I do have completed the French translation which is available here:
http://mchobby.be/wiki/index.php?title=PiBrella-Scratch
and the installation instruction there
http://mchobby.be/wiki/index.php?title=PiBrella-ScratchGPIO5
Enjoy
Dominique
MCHobby.be
Great piece of kit!
We’ve got the basics working but we’re struggling to find details of the inputs and outputs. We’ve already managed to fry an external LED. Are there any projects that we can follow to use the inputs and outputs effectively?
I suggest getting a simple add on board like a Β£10 Pibrella or a PiDie and have a play with that as they are “safer” to use
Remember – standard LEDs need resistors at all times to make sure you don’t fry them π
Simon