0

hope this question is relevant to the community here:

I have installed Scratch GPIO where I hope to turn on LEDs using broadcast 'pinXon' or 'pinXoff' where the X is the GPIO pin to interact with. I also want a single button to take input into scratch, which I know can be achieved by looking at the 'sensor value' of the appropriate GPIO pin.

However, when I go to select a sensor value, my options are limited to:

  • slider
  • light
  • sound
  • resistance-A (through resistance-D)
  • tilt
  • distance
  • motoracount

Strangely, when I open the included program 'blink11', I can select 'pin22' which doesn't appear in my own game.

Is it something to do with the fact I am not explicitly doing something akin to GPIO.cleanup() (in python) at the end of my scratch program? I am certain that 'pin7' was a sensor value option when I opened 'blink11' an hour or 2 ago, suggesting it wasn't cleaned-up after I used it and as such is not available again.

2

I'm Simon Walters the author of ScratchGPIO.

ScratchGPIO is always being developed and major changes occured over Christmas so 1st thing would be to update to latest (it won't affect any projects that you've made)

Currently you should see all the pins (except 11,12,13,15,16 and 18) available as sensor inputs.

The other sensor values slider,light,sound,resistance-A (through resistance-D),tilt and distance are default hard-coded Scratch inputs for use with the original Scratch board - just ignore them.

The inputs are pulled-low which means they normally read 0 and just need a switch and a resistor (1K would be fine) to connect a pin through the switch and a resistor (very important) to a 3.3V pin (NOT 5V)

I will be adding in a option shortly to go back to the original simpler arrangement of setting pins 7 and 22 to be pulled-up but it is not there at this time (21Jan13)

Simon Best to contact me via twitter @cymplecy or post a comment on my blog :)

1
  • I ended up modifying my activity to use a single button on pin7 which appears ~80% of the time (especially when I disable/re-enable remote sensing), so I worked around the problem. Good to know you are still working on it, it has greatly simplified a project I am working on for after-school programming activities. I'll be sure to check out the latest version. Keep it up, thanks!
    – ricky116
    Feb 9 '14 at 22:46
0

use our Pi-Scratch , More hardware support , more easy to install

http://www.pridopia.co.uk/rs-pi-set-scratch.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.