summaryrefslogtreecommitdiffstats
path: root/source/Concept/Framework/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Concept/Framework/main.cpp')
-rw-r--r--source/Concept/Framework/main.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/source/Concept/Framework/main.cpp b/source/Concept/Framework/main.cpp
index a3cd05c..f689d88 100644
--- a/source/Concept/Framework/main.cpp
+++ b/source/Concept/Framework/main.cpp
@@ -59,6 +59,14 @@ int main()
newSensor = NULL;
break;
}
+ case IO_SENSOR_MOUSE_LEFT:
+ case IO_SENSOR_MOUSE_RIGHT:
+ {
+ Mouse_Sensor* newSensor = new Mouse_Sensor(i);
+ localRobot->AddModule(newSensor);
+ newSensor = NULL;
+ break;
+ }
//Other cases
default:
{
@@ -86,9 +94,61 @@ int main()
newDisplay = NULL;
}
+ //Init Keyboards
+ for(uint8 i = IO_KEYBOARD_START; i < IO_KEYBOARD_END; i++)
+ {
+ Keyboard* newKeyboard = new Keyboard(i);
+ localRobot->AddModule(newKeyboard);
+ newKeyboard = NULL;
+ }
+
+ Keyboard* ourKeyboard = localRobot->GetModule<Keyboard>(IO_KEYBOARD_MAIN);
+ IR_Sensor* ourSensor = NULL;
+ uint16 value = 0;
+ Display* ourDisplay = localRobot->GetModule<Display>(IO_DISPLAY_MAIN);
+ uint32 i = 1;
+
//Run
while(true)
{
+ msleep(500);
+ ourDisplay->Clear();
+ ourDisplay->Print(i++);
+ ourDisplay->NewLine();
+ ourSensor = localRobot->GetModule<IR_Sensor>(IO_SENSOR_IR_0_DEG);
+ value = ourSensor->GetIRIntensity();
+ ourDisplay->Print(value, 1, 2);
+ ourDisplay->Print(";");
+ ourSensor = localRobot->GetModule<IR_Sensor>(IO_SENSOR_IR_30_DEG);
+ value = ourSensor->GetIRIntensity();
+ ourDisplay->Print(value);
+ ourDisplay->Print(";");
+ ourSensor = localRobot->GetModule<IR_Sensor>(IO_SENSOR_IR_60_DEG);
+ value = ourSensor->GetIRIntensity();
+ ourDisplay->Print(value);
+ ourDisplay->Print(";");
+ ourSensor = localRobot->GetModule<IR_Sensor>(IO_SENSOR_IR_100_DEG);
+ value = ourSensor->GetIRIntensity();
+ ourDisplay->Print(value);
+ ourDisplay->Print(";");
+ ourSensor = localRobot->GetModule<IR_Sensor>(IO_SENSOR_IR_180_DEG);
+ value = ourSensor->GetIRIntensity();
+ ourDisplay->Print(value, 1, 3);
+ ourDisplay->Print(";");
+ ourSensor = localRobot->GetModule<IR_Sensor>(IO_SENSOR_IR_260_DEG);
+ value = ourSensor->GetIRIntensity();
+ ourDisplay->Print(value);
+ ourDisplay->Print(";");
+ ourSensor = localRobot->GetModule<IR_Sensor>(IO_SENSOR_IR_300_DEG);
+ value = ourSensor->GetIRIntensity();
+ ourDisplay->Print(value);
+ ourDisplay->Print(";");
+ ourSensor = localRobot->GetModule<IR_Sensor>(IO_SENSOR_IR_330_DEG);
+ value = ourSensor->GetIRIntensity();
+ ourDisplay->Print(value);
+ ourDisplay->Print(";");
+ ourDisplay->Print(ourKeyboard->GetInput(), 1, 4);
+
localRobot->Update();
}