From b18e19bee517d70d36c00f5561a075d46b0c20bd Mon Sep 17 00:00:00 2001 From: masterm Date: Thu, 22 Feb 2007 23:37:00 +0000 Subject: +++ implemented command handler --- source/Concept/Framework/main.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'source/Concept/Framework/main.c') diff --git a/source/Concept/Framework/main.c b/source/Concept/Framework/main.c index ffc4cc9..8f9c7a2 100755 --- a/source/Concept/Framework/main.c +++ b/source/Concept/Framework/main.c @@ -122,6 +122,14 @@ int main() newKeyboard = NULL; } + //Init Command Handler + for(uint8 i = IO_COMMAND_HANDLER_START; i < IO_COMMAND_HANDLER_END; i++) + { + Command_Handler* newCommandHandler = new Command_Handler(i); + localRobot->AddModule(newCommandHandler); + newCommandHandler = NULL; + } + //Init Position Tracker for(uint8 i = IO_POSITION_TRACKER_START; i < IO_POSITION_TRACKER_END; i++) { @@ -168,7 +176,7 @@ int main() uint16 value = 0; int8 value2 = 0; - Keyboard* ourKeyboard = localRobot->GetModule(IO_KEYBOARD_MAIN); + Command_Handler* ourCommandHandler = localRobot->GetModule(IO_COMMAND_HANDLER_MAIN); uint32 i = 1; Navigator* ourNavigator = localRobot->GetModule(IO_NAVIGATOR_MAIN); Position_Tracker* ourPosition_Tracker = localRobot->GetModule(IO_POSITION_TRACKER_MAIN); @@ -194,7 +202,7 @@ int main() //msleep(50); - if(!(i % 20)) + if(ourCommandHandler->displayDistanceSensors && !(i % 20)) { ourDisplay->Clear(); @@ -215,13 +223,8 @@ int main() ourDisplay->Print(value); ourDisplay->Print(";"); } - - if(!(i % 20)) - { - //ourAktuator->Kick(); - } - uint8 someInput = ourKeyboard->GetInput(); + /*uint8 someInput = ourKeyboard->GetInput(); //ourDisplay->Print("Ready to accept...", 1, 2); switch(someInput) { @@ -262,7 +265,7 @@ int main() case 12: ourLogic->SetKeeper(true); // Reset Position_Tracker break; - } + }*/ //ourDisplay->Clear(); if(!(i % 20)) -- cgit v1.2.3