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 defi 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 fi 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 fi 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 fi rst character in the received string will
be replaced by a ‘T’ (=Timeout). If you however defi 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.
Содержание DLR ASURO
Страница 36: ...ASURO 36 Software Now this screen will show up Click I Agree This screen appears Click Next...
Страница 37: ...ASURO 37 Software The next screen appears Click Install and the next screen appears Wait...
Страница 40: ...ASURO 40 Software Select on the rigth side C C C C is selected Click Add to insert a new tool...
Страница 45: ...ASURO 45 Software Just for try we will open the file C ASURO_src FirstTry test c Click Open...
Страница 74: ...ASURO 74 B ASURO DIAGRAM Appendices...
Страница 75: ...ASURO 75 Appendices C RS 232 Transceiver...
Страница 76: ...ASURO 76 D USB Transceiver Appendices...
Страница 77: ...ASURO 77 E Block diagram ASURO F Block diagram PIC processor Appendices...
Страница 78: ...ASURO 78 G Contents ASURO KIT Appendices...