emeyeraway
Posts: 146
Joined: Tue Mar 24, 2015 7:11 am

Scratch GPIO

Sat May 30, 2015 5:32 pm

When I downloaded Scratch GPIO7, it came with a sample program (GPIOexample) that illustrated three different ways to use the pins, with three different scripts on the stage. The first just uses pin11 to turn an LED on and off. The second makes pin 17 go back and forth between zero and one when "g" is pressed. The third makes pin 1 alternate between on and off when the space bar is pressed. Is there somewhere I can find an explanation of these scripts? Should the second one turn an LED connected to pin 17 off and on?

yoodoo2
Posts: 16
Joined: Sat Jun 02, 2012 9:57 am

Re: Scratch GPIO

Sat May 30, 2015 7:53 pm

I've used Scratch GPIO in conjunction with both the Piglow and Pibrella boards - see here for more details.

Not used anything else directly linked to the GPIO pins yet.

User avatar
B.Goode
Posts: 8579
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Scratch GPIO

Sat May 30, 2015 9:27 pm

The author/maintainer of ScratchGPIO is not an active member of these forums.

Documentation for ScratchGPIO is available here: http://simplesi.net/scratchgpio/visual-command-guide/

The three demonstration loops in GPIOexample.sb all work in the same way, and simply show that there are multiple ways of referring to the gpio pins - as broadcasts and by setting variables.

emeyeraway
Posts: 146
Joined: Tue Mar 24, 2015 7:11 am

Re: Scratch GPIO

Sun May 31, 2015 1:13 am

I should have stated my question more clearly: if I connect an LED through 470ohms to pin 17 (which is normally 3.3V) and the other end to ground, and use Scratch to alternate pin 17 between 0 and 1, should the LED flash off and on? Mine doesn't. It stays on, even as the indicator on the stage for gpio17 switches between 0 and 1.

If the LED isn't supposed to go off and on as the value on pin 17 goes from 0 to 1, what is the significance of 0 and 1 on pin 17?

User avatar
B.Goode
Posts: 8579
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Scratch GPIO

Sun May 31, 2015 6:36 am

Your expectation is correct, but perhaps the demo as supplied requires you to select a valid pin to control, since both pin 17 and pin 1 are fixed voltage power pins and cannot be controlled by software.

Have you tried testing the LED as documented here: http://simplesi.net/scratchgpio/scratch ... t-project/ ? There is a troubleshooting section at the end of that page.

Return to “Beginners”