Motors and sensors not working [Scratch]

I wrote a piece of code in scratch for a rotating turret controlled by my mouse. It was working for a while and then I shutdown my Brickpi+ and turned it back on an hour later and none of the motors worked. The same thing happened with my sensor programs. I am using EV3, I have a brickpi+ and I have Raspbian for Robots “Jessie” This is really frustrating becuse I get my code to work and then the motors don’t. I know it’s not the code because I ran single stepping and it worked…except nothing moved. Can someone please help me? Thanks :slight_smile:

Can you please confirm the BrickPi version? See the three versions here. With the BrickPi3, the motors won’t run unless the batteries have adequate voltage and the power switch is in the ‘ON’ position.

Yeah, it’s the Brickpi+. Also I am always programming while it’s plugged into the wall to it always has 100% battery power. I also program with python and the motors always work when I’m using that. It’s just having issues with scratch.

Hello @smis,

I’m sorry you’re experiencing an issue with Scratch.

Would it be possible to post an image of your code? In Scratch if you right click, you will see an option to save an image. Then it’s a matter of uploading it here.

Also there should be a terminal window in the background that works hand in hand with Scratch. Can you see any error message in that window?

I’ll do my best to get you up and running


Hey @cleoqc
this is what I’m getting in the terminal after running my program 3 times. I can’t copy it but it basically says:
Unable to brodcast
Scratch connections error, retrying
Connected to scratch successfully

I tried to attach a picture of my code but the upload button wasn’t working so can I send it to an you via email? Thanks again, hope we can solve this issue.

Another thing that’s really weird is that every time I make a new scratch program and I want to use a sensor, I do:
brodcast - join S1 EV3US
brodcast - SETUP
brodcast - START
brodcast - UPDATE
say - _______ sensor value

EXCEPT: when I click the options for sensor value and look for S1, it’s not there. I tried unpluging and repluging, saving, closing, reopening, rebooting the pi, I’ve tried everything and I can’t use the motors or sensors…can someone please help, I really want this to work. If it doesn’t I might just have to buy a Lego Mindstorms computer…which I really don’t want to do cuz there like $250.

Hopefully I can offer a quick fix for your last point.
The sensor options will only show up after you’ve done at least one broadcast UPDATE.
broadcast - join S1 EV3US
broadcast - SETUP
broadcast - START
broadcast - UPDATE
and run that once. After it finishes, you should see S1 in the list of sensor values.

Try uploading your program now? You should have access to the upload button now.


Thanks the sensor fix helped :slight_smile: The upload button only works from my PC not my pi so I just have to transfer the image. Thanks

Ok here’s the image hope you can solve me problem :slight_smile:

Thank you for your patience. I have taken a look at your code and I think I know the problem. In each forever loop, add a wait block of about 0.5 second (start with that then adjust if needed). Let me know if that helps.


Here is a screenshot of what you told me to do. I tried countless other variations of what you suggested including changing the length of time (0.1, 1, 5 sec) and changing the placement in the code (at the top, bottom, middle inside the forever) but unfortunately, none of this made a difference. I don’t think it’s the code because it was working the day before yesterday perfectly. Also I wrote a new script for another program and it was working great (Thanks for the tip on the sensors :slight_smile: ) until I shut it down, went out for 3 hours, came back and it wasn’t working. Same code, didn’t change a thing. I’m really confused. I hope you can help me solve my problem. Thanks again, Matt

you are right, if the code once worked and you didn’t change anything of the code at all, then it can’t fail because of the code, and so looking and changing things at/of the code probably is not supposed to help.
What’s left are 2 different possible reasons:
a) your new installation corrupted the Scratch installation
b) you meanwhile might have a hardware failure.
in case of a) I would suggest to uninstall and reinstall Scratch anew,
in case of b) try another Pi with a new Scratch installation, w/o your new software installation -
what do you think?


Ok, so I don’t have another pi and I don’t want to buy one because I payed good money for this. I will try reinstalling scratch and if that doesn’t work I’ll just save my files on my sd card, then erase it, then download the newest version of raspbian for robots. Thanks, I hope this works.

Wait. You may want to also try updating your pi. There should be a update Dexter software icon on the desktop.

Ok…so I didn’t think it could get worse but it did…I tried reinstalling scratch and it didn’t work, so then I saved all my files on my PC, cleared my SD card and got the latest raspbian for robots and followed the Dexter Industries instructions to uncompressed and flash it on to my card. So then I put it back in my pi, turned it on and it ran through the start-up sequence went black screen for 20 seconds and then ran through some more scripts with a bunch of green “Ok’s” and then it turned off. Why is this happening to me!?..

apart from the Pi, is the SD card ok?
(for the future I would strongly recommend to have a 2nd SD for backup reasons, you can make SD image copies easily periodically via the Pi pixel desktop menu tool)

My apologies for not helping out yesterday @smis. I was on the road all day.

Updating Scratch isn’t going to help here but I see you went ahead and re-imaged your card. What is your current status today? I’m assuming you have your Pi connected to a monitor, if you’re able to see the boot go by?


@HaWe The SD card is fine. I thought that might be the issue too so I tried it in my camcorder and it worked just fine.

@cleoqc Yes, I use my second TV monitor for all my work with the pi. It booted too fast for me to see the words but I know it went through a startup boot like it does every time and then it went through another boot and then the monitor said “No signal” This picture might help. It’s what’s in the SD card when I open it on my PC.

At this point, it’s fair to say the SD card didn’t properly copy. Have you used Etcher or Win32DiskImager (if you’re on Windows). Etcher has a mode that verifies the card is ok but in my experience it isn’t failsafe. Win32DiskImager usually does a better job.


@cleoqc I used etcher like the dexter industries page about this told me.