bazo
Posts: 2
Joined: Thu Oct 13, 2022 8:52 am

Scratch 3 GPIO doesn't work

Thu Oct 13, 2022 11:49 am

Hi, I'm new on Raspberry Pi and scratch. I have a Raspberry Pi 3 B. I try to making a LED blink using Scratch 3. I apply everything as in the examples. But it's not working anyway. On the other hand, the script I wrote in python works and the LED is on as I want. What am I missing or doing wrong? I need to help.

User avatar
neilgl
Posts: 5317
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near The National Museum of Computing

Re: Scratch 3 GPIO doesn't work

Thu Oct 13, 2022 12:44 pm

Where are you getting the examples from?

bazo
Posts: 2
Joined: Thu Oct 13, 2022 8:52 am

Re: Scratch 3 GPIO doesn't work

Thu Oct 13, 2022 1:10 pm

Actually I mention about various sources on the web. For example https://www.youtube.com/watch?v=SigUCysYrNY

User avatar
neilgl
Posts: 5317
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near The National Museum of Computing

Re: Scratch 3 GPIO doesn't work

Thu Oct 13, 2022 2:31 pm

The raspberry pi example at https://projects.raspberrypi.org/en/pro ... ch-games/2
worked perfectly for me, using Scratch3 on a pi4 and an LED+resistor on GPIO17 (as in the above example)

Also worked perfectly using GPIO16 as in that youtube link. Check wiring again.
Have you got the correct GPIO numbering (BCM not physical/board) in your python script. See also https://pinout.xyz/#

These commands will set the LED on GPIO 16 on (dh) or off (dl)

Code: Select all

raspi-gpio set 16 op dh
raspi-gpio set 16 op dl

Return to “Scratch”