Discuss Scratch

itchy20
Scratcher
100+ posts

Scratch 2.0 Extension Available for CodeShield

I have released a hardware extension to control the CodeShield board with Scratch 2.0.
You can see a brief video of it in action: http://www.youtube.com/watch?v=vdmDf9VvPUs

and you can download the code at: https://github.com/MrYsLab/CodeShield_Scratch_Extension.

This extension is written in Java using JSON on both the Scratch side and the Arduino/CodeShield side. The code was written so that you can easily adapt it to communicate with any Arduino based project.

dantefrizzoli
Scratcher
100+ posts

Scratch 2.0 Extension Available for CodeShield

Very nice! Thanks for sharing, I will try this out if I can figure it out 0_o lol.


I'm Dante. I am passionate about programming, writing and personal growth.
camodeer
New to Scratch
1 post

Scratch 2.0 Extension Available for CodeShield

hi i am new i dont know how to use this thing
itchy20
Scratcher
100+ posts

Scratch 2.0 Extension Available for CodeShield

There is a pretty extensive set of instructions included in the zip file. Please let me know what problems you are having so I can help you get it running.

itchy20
Scratcher
100+ posts

Scratch 2.0 Extension Available for CodeShield

Apparenlty I added a period to the end of the link. Here is the correct link to github:

https://github.com/MrYsLab/CodeShield_Scratch_Extension

Sorry about any confusion.

Last edited by itchy20 (Aug. 30, 2013 12:42:56)

QuillzToxic
Scratcher
1000+ posts

Scratch 2.0 Extension Available for CodeShield

Cant you make a RSC and scratchGPIO extention
itchy20
Scratcher
100+ posts

Scratch 2.0 Extension Available for CodeShield

I don't know what RSC means. Could you please explain. Also, do you mean Raspberry PI when you refer to scratchGPIO or is this something else?
QuillzToxic
Scratcher
1000+ posts

Scratch 2.0 Extension Available for CodeShield

itchy20 wrote:

I don't know what RSC means. Could you please explain. Also, do you mean Raspberry PI when you refer to scratchGPIO or is this something else?
somthing else posted it on the wrong thread see the tread rasberry pi
toto5065
Scratcher
5 posts

Scratch 2.0 Extension Available for CodeShield

scratch 2.0 web url: Your text to link here… to get offline no errors to updates
or old version scratch 1.4 Your text to link here… NO UPDATES!!!
Available: Windows, 94, 7, Vista, 8l Mac OSX only for Starter and Ultimate

FIRST GAME!
computerawesomeness
Scratcher
100+ posts

Scratch 2.0 Extension Available for CodeShield

camodeer wrote:

hi i am new i dont know how to use this thing
Hello, camodeer! This forum is just Scratch connected with a prototyping board. By any chance, does your name involve hunting? Just wondering.

VIEW MY PROJECT! Scratch Programming Language Simulation! v 1.0.0!
LINK!
sdmeijer
Scratcher
100+ posts

Scratch 2.0 Extension Available for CodeShield

itchy20's new version (Python-based) can be found here: https://github.com/MrYsLab/S2A
sdmeijer
Scratcher
100+ posts

Scratch 2.0 Extension Available for CodeShield

itchy20's new version (Python-based) can be found here: https://github.com/MrYsLab/S2A
sdmeijer
Scratcher
100+ posts

Scratch 2.0 Extension Available for CodeShield

Oops! Double post.

Last edited by sdmeijer (Sept. 16, 2013 14:11:19)

SimpleScratch
Scratcher
500+ posts

Scratch 2.0 Extension Available for CodeShield

Hi Itchy20
Love the fact that you've got Scratch 2 talking to Arduinos
However, I just tried loading the S2ajsonclient.ino into a Leonardo and got these errors

S2AjsonClient:26: error: ‘Encoder’ does not name a type
S2AjsonClient.ino: In function ‘char read_char()’:
S2AjsonClient:100: error: ‘encoder’ was not declared in this scope

Do you have any ideas on what might be going wrong

I'm using Arduino IDE version 1.0.5

regards

Simon


itchy20
Scratcher
100+ posts

Scratch 2.0 Extension Available for CodeShield

Thanks for letting me know about the problem.

Try loading the encoder library at: http://www.pjrc.com/teensy/td_libs_Encoder.html

It contains Encoder.h which is what the sketch is complaining about.

Please let me know if this solves your problem and if it does I will update the documentation with the link.

Sorry about the confusion.

Alan

Last edited by itchy20 (Sept. 21, 2013 20:02:33)

SimpleScratch
Scratcher
500+ posts

Scratch 2.0 Extension Available for CodeShield

Ta - do I just stick encoder,h somewhere or do I put the whole folder somewhere
Got it - I put the whole Encoder folder into Libraries

Simon

Last edited by SimpleScratch (Sept. 21, 2013 22:38:57)

itchy20
Scratcher
100+ posts

Scratch 2.0 Extension Available for CodeShield

Right you are. I should have been more explicit.

Is it working now?
SimpleScratch
Scratcher
500+ posts

Scratch 2.0 Extension Available for CodeShield

yep
Just using it in manual mode by typing commands but I can turn pins off and on just fine now.
I want to explore using it for my ScA for Scratch 1.4 as it would be nice to have a common Arduino client

regards

Simon
itchy20
Scratcher
100+ posts

Scratch 2.0 Extension Available for CodeShield

Great. I am glad it is working.

I am currently looking at some higher performance alternatives to the JSON client. I have not decided if I want to stick with an ascii interface which allows me to test my circuitry just by using the serial monitor (I started writing a sketch to do this a while ago, but it needs to be completed) or to try figuring out pyfirmata which is a binary protocol and a bear to understand and debug.

Alan


SimpleScratch
Scratcher
500+ posts

Scratch 2.0 Extension Available for CodeShield


Well - since you'd used JSON I thought I'd better consider changing my PyFirmata based Scratch 1.4 interface so we could be compatible and save teachers from having to re-program their Arduino's depending on whether the internet was working that day or not - or until we have a fully working off-line Scratch 2

And as you say - the Firmata protocol/code is very densely packed and difficult to reverse engineer for non-experts in it

The Pyfirmata library is quite easy to use however.

If you do continue to use JSON, could I suggest not having S4A specfic constants in it like RGB_GREEN 10 so that a common JSON client could exist like Firmata and specific pin mapping takes place outside of the Arduino code

regards
Simon



Powered by DjangoBB