A web-based alternative to Scratch
All Together Now
You can also use the script shown in Figure 18 to check that everything is working together. The script loops forever waiting for button presses on pin 24. The first time around, when a user presses the button, the script sets pin 17 (connected to your LED) to HIGH, thus switching it on. Then, it waits until the button is pressed again. When it is, it sets pin 17 to LOW, switching the LED to off. Then, the loop starts again.
From the users' perspective, it looks like you're using all the computing power of the Pi just to manage an on/off button (Figure 19) – which is true, but I'm sure you can come up with more exciting projects and expansions for the Snap! programming language, right?
Infos
- Squeak Etoys: http://www.squeakland.org/
- Scratch: http://scratch.mit.edu/
- Snap! homepage: http://byob.berkeley.edu/
- GitHub site for Snap!: https://github.com/jmoenig/Snap--Build-Your-Own-Blocks.git
- RPiGPIO, the whole shebang: https://github.com/pbrown66/snap-RPi
« Previous 1 2 3 4 Next »
Buy this article as PDF
Pages: 9
(incl. VAT)