Discuss Scratch
- Discussion Forums
- » Connecting to the Physical World
- » Inputs and Outputs - is there a solution in Scratch2.0?
- Knochi
-
Scratcher
2 posts
Inputs and Outputs - is there a solution in Scratch2.0?
Hi,
currently I'm developing a small robot with 2 Motors and a few Sensor values.
It would be nice to use it to teach programming and robotics via Scratch. But unfortunately i see no way in connecting Scratch to the Motors.
The Sensors should be no problem by using a picoboard or just hacking the picoboard code into the robots electronics (Arduino compatible)
Another method one may think of is Cloud Variables (which replaced Broadcast messaging somehow). Is it possible to access (write and read) cloud variables from another source than Scratch? A simple web interface with a GET or POST Interface would be sufficient.
Maybe the Log extended by write capabilities.
Then i could write a proxy for the robot that forwards the data from and to the cloud variable storage, similar to the solution that was common in 1.4 and broadcast network messages.
I found out that changing values is a POST request to http://scratch.mit.edu/varserver
{“method” : “set”, “name” : “☁ Test”, “value” : “9”, “user” : “Knochi”, “token” : “a68707f6-f177-4652-9d66-bb2ae6266b00”, “project_id” : “11179503”}
the token value changes from session to session.
If we find out where and how the token value is created we might be able to do a small programm/smartphone app that can change cloud variables and work as an remote control :-)
Thanks
David
currently I'm developing a small robot with 2 Motors and a few Sensor values.
It would be nice to use it to teach programming and robotics via Scratch. But unfortunately i see no way in connecting Scratch to the Motors.
The Sensors should be no problem by using a picoboard or just hacking the picoboard code into the robots electronics (Arduino compatible)
Another method one may think of is Cloud Variables (which replaced Broadcast messaging somehow). Is it possible to access (write and read) cloud variables from another source than Scratch? A simple web interface with a GET or POST Interface would be sufficient.
Maybe the Log extended by write capabilities.
Then i could write a proxy for the robot that forwards the data from and to the cloud variable storage, similar to the solution that was common in 1.4 and broadcast network messages.
I found out that changing values is a POST request to http://scratch.mit.edu/varserver
{“method” : “set”, “name” : “☁ Test”, “value” : “9”, “user” : “Knochi”, “token” : “a68707f6-f177-4652-9d66-bb2ae6266b00”, “project_id” : “11179503”}
the token value changes from session to session.
If we find out where and how the token value is created we might be able to do a small programm/smartphone app that can change cloud variables and work as an remote control :-)
Thanks
David
Last edited by Knochi (July 1, 2013 12:28:20)
- drmcw
-
Scratcher
1000+ posts
Inputs and Outputs - is there a solution in Scratch2.0?
Why do you need to use version 2? I think 1.4 would probably be better suited for what you want.
- technoboy10
-
Scratcher
1000+ posts
Inputs and Outputs - is there a solution in Scratch2.0?
There's an experimental hardware extension protocol in Scratch 2 now. Here's a forum topic with more info. http://scratch.mit.edu/discuss/topic/9457/
- sdmeijer
-
Scratcher
100+ posts
Inputs and Outputs - is there a solution in Scratch2.0?
Have a look at this code: https://github.com/MrYsLab/S2A
- Discussion Forums
- » Connecting to the Physical World
-
» Inputs and Outputs - is there a solution in Scratch2.0?