User manual
ASURO - 69
-
C for ASURO
Example:
The string „Go Ahead“ should be received and we want to be sure all characters do have arrived
at the ASURO before we continue operation.
#include “asuro.h”
int main(void) {
char data[8]; // allocate storage
Init();
SerRead (data,8,0); // Read data
MotorDir(FWD,FWD);
MotorSpeed(120,120);
while(1); // Eternal loop
return 0;
}
.
.
.
9.2.10. void LineData(unsigned int *data)
This function has been developed to read the light intensity of both phototransistors at the
bottomside of ASURO. You will have to de ne an address pointer to a dual integer location
in memory. The function will transfer the AD-converter values of measurement data by both
phototransistors. The rst integer value represents the converter value of the left (T9), the second
integer value represents the converter value of the right (T10) phototransistor. Maximum intensity
(brightness) is referenced by ’1023’, while total darkness
is referenced by ’0’. Normally these extreme values will not be found, and in practice measurement
values will be found in between.
Example:
Reading the light intensity of both phototransistors (T9, T10)
unsigned int data[2]; //Allocate storage
.
.
LineData(data);
data[0] contains the value measured by the left phototransistor (T9)
data[1] contains the value measured by the right phototransistor (T10)