This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.
  • Index
  •  » FAQ
  •  » What does Remote sensor connections mean?

#1 2010-08-14 12:25:34

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

What does Remote sensor connections mean?

I right click on these blocks and I get remote sensor connections. When I click it, I don't understand what it does.


P.S. It does not make it so the sensor board is connected not by USB cable.


[blocks]<forever if>
<else>
<end>[/blocks]

Last edited by zorket (2011-06-22 10:43:19)


Marzipan11 must learn to not spoil

Offline

 

#2 2010-08-14 12:44:24

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: What does Remote sensor connections mean?

It's mesh.

Offline

 

#3 2010-08-14 13:13:54

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: What does Remote sensor connections mean?

Billybob-Mario wrote:

It's mesh.

No, it's a way for external programs to connect with Scratch.


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#4 2010-08-14 13:51:16

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: What does Remote sensor connections mean?

Remote Sensors is a way to connect things, like Python and Scratch. You can make multiplayer with Remote Connections.

http://scratchconnections.wik.is/ <- You can learn more about it there.

Offline

 

#5 2010-08-15 21:27:44

rubiks_cube_guy238
Scratcher
Registered: 2009-07-02
Posts: 100+

Re: What does Remote sensor connections mean?

If you enable remote sensor connections, you canmake Scratch comunicate with other programs, such as Python.
Here is a Python(v2.6) program that connects with Scratch:

# Scratch client test program
# Demonstrates the Scratch Network Connection Functionality


from array import array
import socket
import time

HOST = '127.0.0.1'      # IP address of the remote host (in this case, the local machine)
                              # to connect to Scratch on a different computer, just put in its IP address

PORT = 42001            # The same port as used by the server

# sendScratchCommand(cmd)
# this function packages a message according the Scratch Networking Protocol
# and then sends it off

def sendScratchCommand(cmd):
        n = len(cmd)
        a = array('c')
        a.append(chr((n >> 24) & 0xFF))
        a.append(chr((n >> 16) & 0xFF))
        a.append(chr((n >>  8) & 0xFF))
        a.append(chr(n & 0xFF))
        scratchSock.send(a.tostring() + cmd)

# Make a connection to Scratch
print("connecting...")
scratchSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
scratchSock.connect((HOST, PORT))
print("connected!")
# Emulate the green flag being clicked (optional)
sendScratchCommand('broadcast "scratch-startclicked"')
print("manually starting up Scratch")

# Display broadcasts and global var changes
while 1:
        data = scratchSock.recv(1024)
        if not data: break
        print(data)

scratchSock.close()

Don't ask me why I decided to spend all that time getting the coloring to look like real Python. :P

Last edited by rubiks_cube_guy238 (2010-08-15 21:28:33)


The glass is never half full nor half empty; it is twice as large as it needs to be.

Offline

 

#6 2010-11-28 14:24:16

gabrlmed
Scratcher
Registered: 2009-01-05
Posts: 10

Re: What does Remote sensor connections mean?

i do <<  <not>  >> get it

Offline

 

#7 2010-11-29 00:29:05

Randomstuff
Scratcher
Registered: 2010-06-27
Posts: 11

Re: What does Remote sensor connections mean?

if you turn is on then you can communicate with other stuff like python

Offline

 

#8 2011-01-08 22:34:17

MIT1987
New Scratcher
Registered: 2011-01-08
Posts: 4

Re: What does Remote sensor connections mean?

Randomstuff wrote:

if you turn is on then you can communicate with other stuff like python

Thanks man, exactly what I was looking for.

Offline

 

#9 2011-09-29 13:51:21

BowserJr1
Scratcher
Registered: 2011-09-23
Posts: 6

Re: What does Remote sensor connections mean?

http://scratch.mit.edu/forums/viewtopic.php?id=43522#req_message  smile

Offline

 

#10 2011-12-04 16:22:19

ak24
Scratcher
Registered: 2011-12-04
Posts: 1

Re: What does Remote sensor connections mean?

<forever><forever>

Offline

 
  • Index
  •  » FAQ
  •  » What does Remote sensor connections mean?

Board footer