Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 4DGL-uLCD-SE PinDetect mbed-rtos mbed
main.cpp
00001 #include "mbed.h" 00002 #include "uLCD_4DGL.h" 00003 #include "rtos.h" 00004 uLCD_4DGL uLCD(p28, p27, p30); 00005 #include "Robot.h" 00006 #include "Nav_Switch.h" 00007 BusOut mbedleds(LED1,LED2,LED3,LED4); 00008 Robot myRobot; 00009 Nav_Switch myNav( p21, p22, p23, p24, p25); 00010 00011 int i = 11; 00012 int j = 11; 00013 int C1 = 11; 00014 int C2 = 32; 00015 int C3 = 53; 00016 int C4 = 74; 00017 int C5 = 95; 00018 int C6 = 116; 00019 00020 int main() 00021 { 00022 //Initialize Background 00023 uLCD.filled_rectangle(0, 0 , 127, 127, RED); 00024 myRobot.drawOutline(); 00025 while(i <= 116){ 00026 while(j <= 116){ 00027 myRobot.drawHelper(i,j); 00028 j = j + 21; 00029 } 00030 j = 11; 00031 i = i + 21; 00032 } 00033 myRobot.drawFrog(); 00034 00035 //Auto-pilot Testing 00036 wait(1); 00037 myRobot.drawEraser(); 00038 myRobot.moveForward(); 00039 myRobot.drawFrog(); 00040 wait(1); 00041 myRobot.drawEraser(); 00042 myRobot.moveForward(); 00043 myRobot.drawFrog(); 00044 wait(1); 00045 myRobot.drawEraser(); 00046 myRobot.moveLeft(); 00047 myRobot.drawFrog(); 00048 wait(1); 00049 myRobot.drawEraser(); 00050 myRobot.moveBackward(); 00051 myRobot.drawFrog(); 00052 00053 //Begin Processes 00054 while(1) { 00055 mbedleds = ~(myNav & 0x0F); //update leds with nav switch direction inputs 00056 if(myNav.fire()) mbedleds = 0x0F; 00057 wait(0.02); 00058 } 00059 }
Generated on Thu Jul 28 2022 21:21:25 by
1.7.2