// Testprogramm für Helligkeitssensor
#include "qfixSoccerBoard.h"
#include "LCD.h"
#include "qfixI2C.h"
#include "qfixI2CDefs.h"
SoccerBoard robot;
LCD lcd; // you can use this constructor if the ID is 0
//LCD lcd(); // use this if the ID is not 0. replace 1 by the ID
I2C i2c;
int main()
{
lcd.init();
lcd.clear();
lcd.print("Helligkeitswerte anzeigen");
lcd.cursorhome();
msleep(5000);
lcd.clear();
robot.powerOn(3); // Analog An3 bekommt 5 V!
int Helligkeit = 0;
while(true)
{
lcd.cursorhome();
lcd.clear();
lcd.print("Helligkeit: ");
Helligkeit = robot.analog(3); // Einlesen des Analog-Messwertes
lcd.print_integer(Helligkeit);
msleep(1000); // jede Sekunde Helligkeit anzeigen
}
}