User avatar
soslug
Posts: 41
Joined: Mon May 21, 2012 12:31 pm
Location: Southend on Sea
Contact: Website Yahoo Messenger

Bug in Raspberry Pi + Scratch?

Tue Mar 15, 2016 8:23 pm

I have found what I believe is a bug in the current Jesse build for Raspberry Pi 2 B+ and Raspberry Pi 3 using the new GPIO format relating to Scratch 1.4.

Following the documentation provided here was the groundwork for my assumption.
https://www.raspberrypi.org/documentati ... /README.md

I used the following after starting the gpioserver in edit, and yes device tree, spi and I2c are all enabled I am also confident I am on the correct gpio pins as I can address the pins without the variable foo as per example of above document and get it to work correctly.

broadcast config14out
set foo 14
broadcast join gpio join foo on

If I use

broadcast config14out
set foo 14on
broadcast join gpio foo

The above works ok, but if I put two joins together to concatenate gpio, 14 & on or off it does not.
By hovering the mouse over the broadcast command it looks as though the concatenate is introducing spaces and this may be a reason why it is not working, it could also be two "join" commands cannot be used together not sure.
It seems to have the effect of "broadcast gpio 14 on" which does not seem to work this way.

Only "broadcast gpio14on" or "broadcast gpio14off" works

The same is true of other gpio values

Also previous versions allowed the use of ."broadcast gpio all off" current version is not working neither is it working as
"broadcast gpioalloff"

I am not sure the forum is correct place to report bugs for scratch if not please advise accordingly. However if someone could verify my findings this will be most helpful.
IPFreely, to weed the network demons that dwell in them their Windows!

MarcScott
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 81
Joined: Sat Aug 08, 2015 11:30 am

Re: Raspberry Pi + Scratch for non computer users

Wed Mar 16, 2016 8:14 am

That's odd. The described setup (as shown in the attachment) is working for me.
I can confirm that broadcast(gpioalloff) does not work though
Attachments
screenshot.png
screenshot.png (12.61 KiB) Viewed 1339 times

timrowledge
Posts: 1312
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Bug in Raspberry Pi + Scratch?

Mon Mar 21, 2016 6:54 pm

soslug wrote: broadcast config14out
set foo 14
broadcast join gpio join foo on

If I use

broadcast config14out
set foo 14on
broadcast join gpio foo

The above works ok, but if I put two joins together to concatenate gpio, 14 & on or off it does not.
By hovering the mouse over the broadcast command it looks as though the concatenate is introducing spaces and this may be a reason why it is not working, it could also be two "join" commands cannot be used together not sure.
Join does not introduce spaces and you can chain many of them together without issues. The most likely problem here is that you simply missed a space when typing in your value in the little editing dialogue; it happens sometimes with small fonts.
soslug wrote:It seems to have the effect of "broadcast gpio 14 on" which does not seem to work this way.

Only "broadcast gpio14on" or "broadcast gpio14off" works

The same is true of other gpio values.
Those spaces get interpreted as asking for separate broadcasts, so you're sending
gpio
14
on
none of which would actually do anything. Originally I introduced using a space as a way to allow multiple broadcasts in a single line and it's possible that was a mistake - though the original reviewers didn't raise any issues.
soslug wrote:Also previous versions allowed the use of ."broadcast gpio all off" current version is not working neither is it working as
"broadcast gpioalloff"
There was no previous version, so this cannot be correct. You may be thinking of Simon's ScratchGPIO Python program, which is a quite different thing. The builtin GPIOServer does not handle 'gpioalloff'.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

Return to “Scratch”