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

#1 2012-10-05 05:03:04

danidelrio
New Scratcher
Registered: 2012-10-05
Posts: 2

Developing scratch Connection with Moway robot

Hi,

I am working in the scratch compatibility with Moway Robot (www.moway-robot.com).

I have a C# program running and working fine. I use the Radiofrecuency communication between Moway Robot and the PC to send and receiver messages and real-time operation.

I have a possible problem with the sensor-update. I have several variables with the movement parameters speed, time, distance, etc..

The problem is that whenever I send an order to the robot I use a broadcast message (for example "straight") and take the values of the variables to perform the movement. If the variables don't change there is no "sensor-update" message. As this connection is working through and RF link it is possible to loose some information.

The question is. Is there any way of forcing a sensor-update to be sent?

Once we have finished we will post all the work to program Moway Robots using Scratch.

Thank you in advance.

Daniel del Río

Offline

 

#2 2012-10-05 06:20:03

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Developing scratch Connection with Moway robot

Since Broadcast message names are sent out on the port - why not use the Join block to build a variable with your own message header and the variable value - and then just Broadcast the variable?  I think that would work whether the value had changed or not. 

when I receive [Straight v]
set [Message v] to (join [Straight - ] (Distance))
broadcast (Message)

Last edited by Paddle2See (2012-10-05 06:21:57)


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2012-10-05 07:15:54

danidelrio
New Scratcher
Registered: 2012-10-05
Posts: 2

Re: Developing scratch Connection with Moway robot

Thanks! Good idea! I will try this solution

Offline

 

Board footer