Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
69 lines (50 sloc) 2.02 KB
/*
* Copyright (c) 2012 Evgeny Proydakov <lord.tiran@gmail.com>
*/
#ifndef DISPLAY_H
#define DISPLAY_H
sub display_distance(float distance)
{
ClearScreen();
TextOut(0, LCD_LINE1, " TASK COMPLETED ");
TextOut(0, LCD_LINE4, "DISTANCE:");
NumOut(60, LCD_LINE4, distance);
TextOut(0, LCD_LINE7, " Virus TEAM ");
}
sub display_odometry(float distance, float angle)
{
ClearScreen();
TextOut(0, LCD_LINE1, " ODOMETRY ");
TextOut(0, LCD_LINE3, "DISTANCE:");
NumOut(60, LCD_LINE3, distance);
TextOut(0, LCD_LINE4, "ANGLE:");
NumOut(60, LCD_LINE4, angle);
TextOut(0, LCD_LINE7, " Virus TEAM ");
}
task display_sensor_values()
{
int color_value=0;
int r=0, g=0, b=0;
while(TRUE)
{
TextOut(0, LCD_LINE1, "Sensor Values:"); // outputs text in the first row of the LCD display
TextOut(0, LCD_LINE2, "US 1:");
NumOut(50, LCD_LINE2, SensorUS(IN_1)); // outputs first ultrasonic sensor values in the 2. row of the LCD display
TextOut(0, LCD_LINE3, "US 2:");
NumOut(50, LCD_LINE3, SensorUS(IN_2)); // outputs second ultrasonic sensor values in the 3. row of the LCD display
TextOut(0, LCD_LINE4, "Light:");
NumOut(50, LCD_LINE4, Sensor(IN_3)); // outputs light sensor values in the 4. row of the LCD display
TextOut(0, LCD_LINE5, "color:");
ReadSensorHTColor(IN_4, color_value, r, g, b);
NumOut(50, LCD_LINE5, color_value); // outputs color sensor values in the 5. row of the LCD display
TextOut(10, LCD_LINE6, "r:");
NumOut(50, LCD_LINE6, r); // outputs color sensor values in the 6. row of the LCD display
TextOut(10, LCD_LINE7, "g:");
NumOut(50, LCD_LINE7, g); // outputs color sensor values in the 7. row of the LCD display
TextOut(10, LCD_LINE8, "b:");
NumOut(50, LCD_LINE8, b); // outputs color sensor values in the 8. row of the LCD display
Wait(250);
ClearScreen();
}
}
#endif // DISPLAY_H
Something went wrong with that request. Please try again.