User avatar
mikronauts
Posts: 2710
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Which Scratch is easier to extend?

Thu Jan 23, 2014 1:32 am

Hi,

I've never used Scratch, but I want to add to it so it supports my upcoming Pi products.

From reading the forum, it seems there are two different versions of Scratch for the Pi:

http://cymplecy.wordpress.com/scratch-raspberrypi-gpio/

and "a new Scratch"

http://www.raspberrypi.org/phpBB3/viewt ... 77&t=66308

I will download and try them both shortly, but I'd appreciate feedback as to which one would be easier for a newbie to Scratch (but experienced) developer to extend for I/O expanders, ADC's, PWM control, servo control etc.

I've used both WiringPi and PiGPIO with great success for testing, but now I want to add support for Scratch.

I'd appreciate any and all feedback!
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

ghp
Posts: 1395
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: Which Scratch is easier to extend?

Thu Jan 23, 2014 6:32 am

Hello,

scratch on its own is Version 1.4 on RPi. It has no build in hardware connections by itself, but can do this by an external client code.
The new scratch version from Tim Rowledge is a faster implementation, but functionally the same. It is quite buggy at the moment. I would not recomment using this at the moment.
There are several implementations for a scratch-hardware-adapter aka scratchclient at the moment.

simplesi has a code on his page http://cymplecy.wordpress.com/

In my school workshop I use an own implemenatation, see
http://www.heppg.de/ikg/administration/ ... Client.pdf
http://www.heppg.de/ikg/administration/ ... ent.tar.gz

In one of the posts I have seen a link to https://pypi.python.org/pypi/scratch, which is a very basic library to connect scratch and python.

Greetings
Gerhard

User avatar
mikronauts
Posts: 2710
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Which Scratch is easier to extend?

Thu Jan 23, 2014 5:09 pm

Gerhard,

Thank you. That was very helpful, exactly the type of information I was looking for.

I quickly read the pdf, and will dive into it in greater detail :)

Best Regards,

Bill
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

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

Re: Which Scratch is easier to extend?

Thu Jan 23, 2014 7:59 pm

Which version of scratch is easier to extend depends upon several important factors.
Do you know Smalltalk? In particular Squeak.
What sort of extensions are you wanting to build? Simon has demonstrated how one can use the external broadcast system to talk to other applications that then do the hardware interfacing, so you could potentially make your extensions without touching the Scratch code at all. At least a couple of people are working on making a VM plugin (which is how we extend the Squeak virtual machine) to talk to the GPIO pins directly, which would then need some additional Smalltalk code to drive it.

If you follow Simon's lead then it doesn't matter much which version of Scratch you use, obviously. If you want to get down and dirty in the code then I'd recommend sticking the the newer version since it is based on the latest Squeak system, with a lot of benefits therefrom. Not least being that it is the version that will get supported in the future.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

User avatar
mikronauts
Posts: 2710
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Which Scratch is easier to extend?

Thu Jan 23, 2014 8:11 pm

Thank you for the info!

While I've not programmed in Smalltalk, I have programmed both in Lisp (which I liked) and Prolog (not so much).

I'll take a look at Squeek's VM.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

tonychang-uk
Posts: 92
Joined: Mon Jun 18, 2012 1:42 pm

Re: Which Scratch is easier to extend?

Thu Jan 23, 2014 8:44 pm

mikronauts wrote:Hi,

I've never used Scratch, but I want to add to it so it supports my upcoming Pi products.

From reading the forum, it seems there are two different versions of Scratch for the Pi:

http://cymplecy.wordpress.com/scratch-raspberrypi-gpio/

and "a new Scratch"

http://www.raspberrypi.org/phpBB3/viewt ... 77&t=66308

I will download and try them both shortly, but I'd appreciate feedback as to which one would be easier for a newbie to Scratch (but experienced) developer to extend for I/O expanders, ADC's, PWM control, servo control etc.

I've used both WiringPi and PiGPIO with great success for testing, but now I want to add support for Scratch.

I'd appreciate any and all feedback!
You forget one more "Pi_Scratch" more hardware Support 4hub/7hub i2c RTC & Temperature sensor, AD/DA, EEPROM
i2c 8,16,32,64,128 GPIO board, spi 16,32,64,128 GPIO board , GPIO relay, DC Motor, stepper Motor ,
GPIO 16x2 LCD ,20x4 LCD , 84x48 LCD, i2c 16x2 LCD, i2c 20x4 LCD, i2c PWM/servo board, 16x16 ,24x16 LED matrix
1-Wire DS18B20 Temperature Sensor, i2c BMP085 Barometric Pressure/Temperature/Altitude Sensor
Ultrasonic Distance Sensor , spi mcp3002/mcp4802 AD/DA , Maplin USB Robot ARM control ,
New i2c & GPIO LCD command , DHT22 Digital Temperature & Humidity Sensor ,IR- Line Hunting sensor,
IR -Flame sensor 6 DOF (Degrees of Freedom) Servo Robot Arm .....
IR- PIR Motion sensor
detail in the link
http://www.pridopia.co.uk/rs-pi-set-scratch.html

User avatar
mikronauts
Posts: 2710
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Which Scratch is easier to extend?

Thu Jan 23, 2014 10:45 pm

thank you tony chang... will check it out.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Metaja
Posts: 8
Joined: Thu Jan 30, 2014 10:02 am

Re: Which Scratch is easier to extend?

Thu Jan 30, 2014 3:15 pm

Hi all,

Probably, you will be interested in Phratch. The main goal is to provide an easy extendable Scratch. I presented it in http://www.raspberrypi.org/forum/viewto ... 64#p496764.

Best

User avatar
mikronauts
Posts: 2710
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Which Scratch is easier to extend?

Thu Jan 30, 2014 4:23 pm

Thanks Metaja!
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

mob-i-l
Posts: 256
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Google+ Twitter YouTube

Re: Which Scratch is easier to extend?

Sat Feb 08, 2014 2:42 pm

In this project http://scratch.mit.edu/projects/13703270/ I use https://github.com/pilliq/scratchpy to connect to the outside world.
Have Pi0&1A&1B&1B+&2B&3B&4B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/

User avatar
mikronauts
Posts: 2710
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Which Scratch is easier to extend?

Sat Feb 08, 2014 3:22 pm

Thank you, I'll check it out!
mob-i-l wrote:In this project http://scratch.mit.edu/projects/13703270/ I use https://github.com/pilliq/scratchpy to connect to the outside world.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

User avatar
williamhbell
Posts: 291
Joined: Mon Dec 26, 2011 5:13 pm
Contact: Website Twitter

Re: Which Scratch is easier to extend?

Sat Feb 28, 2015 1:59 pm

Or you could use:
https://pypi.python.org/pypi/RpiScratchIO/0.1.7
which is very easy to extend to any I/O device. There is some extended documentation in Issues 23 and 22 of the MagPi.

clic17
Posts: 2
Joined: Fri Feb 05, 2016 9:53 am

Re: Which Scratch is easier to extend?

Fri Feb 05, 2016 1:41 pm

Hi,
is there any way to use a 12x2 LCD with the included GPIO functions in the new Raspbian?

I know Pi_Scrach has it..

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

Re: Which Scratch is easier to extend?

Sat Feb 06, 2016 3:34 am

clic17 wrote:Hi,
is there any way to use a 12x2 LCD with the included GPIO functions in the new Raspbian?
Without knowing anything about the lcd I can't offer any sort of opinion. If it simply uses gpios then you ought to be able to make it work. If it uses 12c or api stuff that would be a bit more complex.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

User avatar
DougieLawson
Posts: 35594
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Which Scratch is easier to extend?

Sat Feb 06, 2016 7:45 am

timrowledge wrote:
clic17 wrote:Hi,
is there any way to use a 12x2 LCD with the included GPIO functions in the new Raspbian?
Without knowing anything about the lcd I can't offer any sort of opinion. If it simply uses gpios then you ought to be able to make it work. If it uses 12c or api stuff that would be a bit more complex.
I'd guess the OP means a 16x2 HD44780 which is the commonest and easiest of the LCD displays to use.

I've got some code here: https://github.com/DougieLawson/Raspber ... nified_LCD that will drive a HD44780 LCD either from GPIO, through a MCP23017 (I2C) chip or MCP23S17 (SPI) chip. Feel free to use that in any way you like.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

clic17
Posts: 2
Joined: Fri Feb 05, 2016 9:53 am

Re: Which Scratch is easier to extend?

Sun Feb 07, 2016 5:00 pm

yes, I am using a Hitachi HD44780 with direct GPIO connection without I2C.
This is my python code and wiring diagram:
https://github.com/christianimmler/python_LCD

The question was, how to connect it with Scratch?

User avatar
DougieLawson
Posts: 35594
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Which Scratch is easier to extend?

Sun Feb 07, 2016 5:27 pm

clic17 wrote:yes, I am using a Hitachi HD44780 with direct GPIO connection without I2C.
This is my python code and wiring diagram:
https://github.com/christianimmler/python_LCD

The question was, how to connect it with Scratch?
Scratch will need a driver module or you're going to have to wiggle GPIO pins in the right order with the right timing to drive it from your scratch program. You may by able to do that with Simon Walter's ScratchGPIO stuff.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Scratch”