This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-03-08 15:16:17

MikeWTeaches
New Scratcher
Registered: 2012-03-08
Posts: 2

Integrating scratch with other software

Hello everyone,

I'm new here, but I have searched and haven't found a topic dealing with this issue so I thought I'd post one.

While browsing the forum, I was introduced to the concept of using Scratch with an external control board for sensor input and actuator output. This is pretty cool, although I was looking for a >software< API so that Scratch could be integrated with other software.

What I'm thinking of doing is using Scratch to control a USB device (via an interface that I'll build in .NET). Is there an API for Scratch or a way to read output from Scratch (can Scratch write to simple text files?).

Any thoughts would be warmly appreciated!

Many thanks,

Mike

Offline

 

#2 2012-03-08 15:58:13

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Integrating scratch with other software

Yes, there is one API for doing this. It is called remote sensors connections. It allows you to use sockets to control Scratch sensors. Information can be found on the Scratch wiki here. You'll need to port the code into .NET, though. If you have any questions, please ask me--I specialize in remote sensor connections.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#3 2012-03-09 15:57:04

MikeWTeaches
New Scratcher
Registered: 2012-03-08
Posts: 2

Re: Integrating scratch with other software

bobbybee wrote:

Yes, there is one API for doing this. It is called remote sensors connections. It allows you to use sockets to control Scratch sensors. Information can be found on the Scratch wiki here. You'll need to port the code into .NET, though. If you have any questions, please ask me--I specialize in remote sensor connections.

Thanks for your reply, bobbybee  smile

This sounds like almost the exact opposite of what I want to do  smile  I'd like Scratch instead of sensing via an API, to transmit via an API. In other words, press a button on a Scratch project and have an event fire off some external process.

Can that be done?

The only way that I've thought of getting control signals OUT of scratch is to stick a light dependent resistor to a monitor and have scratch control the brightness of a square underneath it. Not exactly graceful.

Thanks in advance once again  big_smile

All the best and have a good weekend!

Mike

Offline

 

#4 2012-03-10 08:58:23

SJRCS_011
Scratcher
Registered: 2011-02-07
Posts: 1000+

Re: Integrating scratch with other software

MikeWTeaches wrote:

bobbybee wrote:

Yes, there is one API for doing this. It is called remote sensors connections. It allows you to use sockets to control Scratch sensors. Information can be found on the Scratch wiki here. You'll need to port the code into .NET, though. If you have any questions, please ask me--I specialize in remote sensor connections.

Thanks for your reply, bobbybee  smile

This sounds like almost the exact opposite of what I want to do  smile  I'd like Scratch instead of sensing via an API, to transmit via an API. In other words, press a button on a Scratch project and have an event fire off some external process.

Can that be done?

The only way that I've thought of getting control signals OUT of scratch is to stick a light dependent resistor to a monitor and have scratch control the brightness of a square underneath it. Not exactly graceful.

Thanks in advance once again  big_smile
All the best and have a good weekend!

Mike

Yes, that can be done.  Basically, using the method on the wiki page, when the button clicked in Scracth, have it set a variable to a value that the other project then picks up


http://i.imgur.com/vQqtH.png
Learning to Program in a Nutshell:  "You're missing a closing parentheses" - LS97

Offline

 

Board footer