![Arexx DLR ASURO Скачать руководство пользователя страница 70](http://html.mh-extra.com/html/arexx/dlr-asuro/dlr-asuro_assembly-and-operation-manual_2967241070.webp)
ASURO - 70 -
Of course you would like an example as a complete program:
#include “asuro.h”
// Line tracing the easiest way
int main(void) {
unsigned int data[2];
// Allocate storage
Init();
FrontLED(ON);
// Switch ON line trace illumination
MotorDir(FWD,FWD);
// Both engines go ahead
while(1){
// Eternal loop, ASURO should follow
// a line eternally
LineData(data);
// Read brightness data from Phototransistors
if (data[0]>data[1])
// left brighter than right
{MotorSpeed(200,150);} // ... speed up left motor
else
{MotorSpeed(150,200);} // ... speed up right motor
}
return 0;
}
9.2.11. void OdometrieData(unsigned int *data)
The function scans the refl ected light-sensor: Both LED (D13, D14) are activated and the function
returns the AD-converter values of the phototransistors (T11, T12). As in the function LineData() a
storage area with two integer values must be provided, which will be fi lled by the function. The fi rst
integer value contains the AD-value delivered by the left (T11), the second integer value contains
the AD-value delivered by the right (T12) phototransistor. Maximum brightness is referenced by a
value ’0’ while absolute darkness is represented by value ’1023’
5
. Normally these extreme values
will not be found, and in practice measurement values will be found in between.
Example:
Scanning the refl ected light-sensors.
unsigned int data[2]; //Allocate memory
.
.
OdometrieData(data);
data[0] containes data from the left phototransistor (T11)
data[1]containes data from the right phototransistor (T12)
Just to prevent misinterpretations: OdometrieData() does not provide the number of revolutions,
but the actual illumination at the refl ected light-sensors. Discerning bright and dark levels, counting
light-dark transitions and counting the number of revolutions is left to be a programmer’s job.
5
To simplify the hardware circuit these values do not correspond to the values found in the line
tracing module.
C for ASURO
Содержание 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...