User manual
ASURO - 68
-
C for ASURO
9.2.7. void MotorSpeed (unsigned char left_speed, unsigned char right_speed)
This function controls the motor speed for both engines. Maximum speed is 255 (unsigned char).
The motor will start rotating at a value of around 60, depending on mechanical conditions. The
parameter value in fact controls motor power and the rotational speed also depends on other
factors like friction or inclination in slopes.
Example:
The left motor is to move at maximum speed, the right motor not at all. The direction of movement
has previously been de ned by MotorDir ().
MotorSpeed (255,0);
9.2.8. void SerWrite (unsigned char *data, unsigned char length)
This function outputs data from ASURO by the serial IR-interface at 2400Bit/s, No-parity, 1 StopBit,
NoFlowControl. The rst parameter contains the reference to the data to be sent, while the second
parameter describes the number of characters to be sent.
Example:
A string „Hello how are you?“ should be sent by IR-interface:
SerWrite (“Hello how are you?”,18);
9.2.9. void SerRead(unsigned char *data, unsigned char length, unsigned int timeout)
Once you are able to transmit data by IR-interface, you may probably also wish to receive some.
The next function will allow you to do so. The rst parameter is a pointer to the storage address,
where you would like to store the message. The second parameter describes how many
characters are expected, while the third parameter describes a timeout period. Timeout is used to
prevent eternal waiting periods if less data than expected do arrive. If after a given timeout period
no more data arrive, the function will be aborted and the rst character in the received string will
be replaced by a ‘T’ (=Timeout). If you however de ne a third parameter ’0’, the function will not
abort, but wait, until the last of the expected number of characters has arrived.
As soon as this function has been executed ASURO will start moving. Sometimes the
program however results in unexpected movements and we must take care ASURO
cannot do any harm to others or itself.