simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

What to set GPIO pin default states to in ScratchGPIO

Mon Jan 13, 2014 6:14 pm

One issue that I've been around the houses on with ScratchGPIO is default pin states.

My original V1 set 11,12,13,15,16,18 as outputs and 7 and 22 as inputs with internal pull-ups

This made it very easy to connect some LEDs to 11..18 and a couple of switches wired to gnd to provide inputs.

With the ploliferation of add-on board support I've ended up with 2 desktop icons

ScratchGPIO+ which doesn't set any default state for any pin which then relies on selecting an add-on board which customises the pins for its use (this bit seems fine)
Also, since it doesn't set any pin default state, its pretty safe to use it for nuclear power control projects and it won't cause a reactor scram when your run it :)

The other icon is just ScratchGPIO and currently it sets 11,12,13,15,16,18 as outputs and all other pins as inputs with pull-down.

My thinking was that this was a "safe" setup and also not likely to cause a reactor scram but I've had a message from @abee basically saying "I'm trying to write a book and I've noticed you've completely changed things!" :)

So before he sends his book off to the printer, I'd like to maybe decide what the default should be
Stick with the above, change back to pull-ups, make it half and half?????

All ideas and suggestions welcome from people with experience of using ScratchGPIO :)

regards

Simon
Sc
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

abee
Posts: 24
Joined: Wed Feb 27, 2013 5:47 am

Re: What to set GPIO pin default states to in ScratchGPIO

Tue Jan 14, 2014 3:43 am

Hi Simon,
Thank you very much.
We have already taken pictures and drawn diagrams for version 4.
In fact we have almost finished proofreading. Our print shop cannot wait for more modifications.
So we are very happy if you place a command for downloading old version on the same page in same format as follows.

1 sudo wget http://goo.gl/dANpKr -O isgh.sh

http://cymplecy.wordpress.com/2013/04/2 ... beginners/

It would be great help for us.
Thank you for your consideration.

Kazuhiro Abe

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: What to set GPIO pin default states to in ScratchGPIO

Tue Jan 14, 2014 7:18 am

Aah :(

What do you need ScratchGPIO4 to do - default out on 11,12,13,15,16,18?

default in on 7 and 22 with pull-ups?

What about other pins?

Simon

PS Still welcome suggestions on the actual best default
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

abee
Posts: 24
Joined: Wed Feb 27, 2013 5:47 am

Re: What to set GPIO pin default states to in ScratchGPIO

Tue Jan 14, 2014 5:42 pm

I wrote my book based on the following version.

Version = '4.0.09' # 3Dec13

Especially pin 22 should be input and pull-up. I use this pin for the tact switch in my book.
And pin 11, 12, 13 should be output. I use those pins for the DC motor driver (TP7291P).

Also I referred your documentation.
"As it comes, you can control six pins as outputs (Pins 11,12,13,15,16 and 18) and treat all the rest as simple inputs (22,7,3,5,24,26,19,21,23,8 and 10)"
http://cymplecy.wordpress.com/2013/04/2 ... beginners/
And the following page.
http://cymplecy.wordpress.com/2013/12/2 ... mentation/

Could you please add a link for the previous version (4.0.09) ?
I think it is a best solution for my readers.
Thank you.

Kazuhiro Abe

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: What to set GPIO pin default states to in ScratchGPIO

Tue Jan 14, 2014 9:07 pm

I'll just change ScratchGPIO4 back to those settings :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: What to set GPIO pin default states to in ScratchGPIO

Tue Jan 14, 2014 9:17 pm

Next time - talk to me BEFORE writing book :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

abee
Posts: 24
Joined: Wed Feb 27, 2013 5:47 am

Re: What to set GPIO pin default states to in ScratchGPIO

Wed Jan 15, 2014 5:49 am

I appreciate your kindness.
I promise that I will ask you before writing a book next time.

I re-install all environment by the instruction. The version number is "v4.1.09a # 11Jan13". (not changed)
It seems pin22 is still pull-down. Could you please check it again?
And dynamic appending of input pins to the sensor menu did not roll back. It looks that all input pins appears on the menu at startup. It is OK. Just a confirm.

Thank you.
Kazuhiro Abe

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: What to set GPIO pin default states to in ScratchGPIO

Wed Jan 15, 2014 7:15 am

I haven't done it yet but I will do shortly :)
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

bantammenace2012
Posts: 122
Joined: Mon May 28, 2012 12:18 pm

Re: What to set GPIO pin default states to in ScratchGPIO

Wed Jan 15, 2014 10:43 am

Abe, I like the cut of your jib.
I think it's now 1-1 with Simon.
I trust your relationship will continue to bloom. :D :D :D
Is it a secret or can you tell us what the book is about and who the target audience is ?
kind regards.

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: What to set GPIO pin default states to in ScratchGPIO

Wed Jan 15, 2014 10:53 am

@bantammenace
How's your Japanese reading skills? :)
Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

abee
Posts: 24
Joined: Wed Feb 27, 2013 5:47 am

Re: What to set GPIO pin default states to in ScratchGPIO

Thu Jan 16, 2014 8:06 pm

bantammenace2012 wrote:Abe, I like the cut of your jib.
I think it's now 1-1 with Simon.
I trust your relationship will continue to bloom. :D :D :D
Is it a secret or can you tell us what the book is about and who the target audience is ?
kind regards.
Hi bantammenace2012
There is no secret. :) Here it is.
http://www.amazon.co.jp/dp/4822297314/
We were talking at the Simon's ScratchGPIO site at first. Then we moved here.
This book focuses age 8 and older. And it contains:

- How to setup your Raspberry Pi
- Introduction to Scratch
- Controlling Minecraft Pi from Scratch
- Controlling GPIO from Scratch

I hope young people find something of value in this book.

Kazuhiro Abe

abee
Posts: 24
Joined: Wed Feb 27, 2013 5:47 am

Re: What to set GPIO pin default states to in ScratchGPIO

Sat Jan 18, 2014 7:53 am

Hi Simon,
How are things going?
If rollback is difficult, please put a link of the old version.

Version = '4.0.09' # 3Dec13

Thank you for your effort.
Kazuhiro Abe

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: What to set GPIO pin default states to in ScratchGPIO

Sat Jan 18, 2014 9:45 am

Hi
I don't want to change the current stable version as there is an important educational show next week over here and my stuff is being used and demonstrated http://www.bettshow.com/ and I thought your book is not published yet.

The link points to the stable version so the only way to revert the codebase is to change the stable version :(

I will do it next weekend - sorry about delay but as you can see - I was not anticipating someone writing a book at this stage in its development

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

abee
Posts: 24
Joined: Wed Feb 27, 2013 5:47 am

Re: What to set GPIO pin default states to in ScratchGPIO

Sat Jan 18, 2014 5:19 pm

Hi Simon,
Thank you for your reply. I understand your situation.
I decide to rewrite the chapter of ScratchGPIO. New article will be based on Version 4.1.09 2Jan2014. I think it is a best way for all.
There is only one thing I ask of you. Could you please keep the link of Version 4.1.09 2Jan2014 for download in the future?
I think this never block the evolution of ScratchGPIO.
I am truly grateful for your consideration.

Best,
Kazuhiro Abe

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: What to set GPIO pin default states to in ScratchGPIO

Sat Jan 18, 2014 5:48 pm

I thought you said it was too late to change anything???

If you can wait a week - I can revert it to previous state and keep that link locked for you :)

Best way is to not directly link to my site but to take a copy onto your own controlled site and link to that and just mention that my site might have an updated version :)

I don't know what to do now for the best :(

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

abee
Posts: 24
Joined: Wed Feb 27, 2013 5:47 am

Re: What to set GPIO pin default states to in ScratchGPIO

Sat Jan 18, 2014 6:52 pm

Hi Simon,
This means I decided to delay the publish of my book.
The project files and circuits of 4.1.09a are incompatible with 4.0.09's. And 4.1.09a is more stable than 4.0.09. Those are reasons of my decision.

As you wrote, making my own static copy is one solution.
However your web site is the official site of ScratchGPIO. I'm afraid many original branches might confuse user.
Many software sites provide the both of stable and experimental version, and they keep the downward compatibility of files.
ScratchGPIO is a great software for the people especially kids.
So it is important the balance of evolution and stability, I think.

Best,
Kazuhiro Abe

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: What to set GPIO pin default states to in ScratchGPIO

Sun Jan 19, 2014 12:54 am

OK :)

I will keep current stable version with current pin default states

And I will try and make copies of old versions available from now :)

If I make big change I will change to V5 from V4

To make all pins to default to input using pullups you can say

broadcast setpinshigh

then
broadcast config11out
broadcast config12out
broadcast config13out
broadcast config15out
broadcast config16out
broadcast config18out

and you should have same state as old version

Sorry about the trouble and problems we have had

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

abee
Posts: 24
Joined: Wed Feb 27, 2013 5:47 am

Re: What to set GPIO pin default states to in ScratchGPIO

Thu Jan 23, 2014 12:11 pm

Hi Simon,
I have submitted all manuscripts to the publisher.
The new article of ScratchGPIO is based on 4.1.09a, all input pins are pull down as default. And I added a footnote that explains how to change pull up or down pins by message.
I'm grateful for your commitment to my book.

Cheers,
Kazuhiro Abe

abee
Posts: 24
Joined: Wed Feb 27, 2013 5:47 am

Re: What to set GPIO pin default states to in ScratchGPIO

Thu Jan 23, 2014 12:34 pm

This is the final version of the cover.
Image

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: What to set GPIO pin default states to in ScratchGPIO

Thu Jan 23, 2014 1:37 pm

Your welcome :)

Look forward to reading it :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: What to set GPIO pin default states to in ScratchGPIO

Thu Jan 23, 2014 6:48 pm

Given all the feedback :) I think I'm going to have 3 launchers in ScratchGPIO V5

1. ScratchGPIO - all pins defaulting to inputs with pull-down enabled (apart from pins 3 and 5 with their physical pull-ups) Safest mode I think

2. ScratchGPIO Starter - 11,12,13,15,16,18 as outputs, all other pins as inputs with pull-ups enabled - ideal for new users.

3. ScratchGPIO+ - Same as No 1 but will be depreciated


Any comments people ?

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

Return to “Scratch”