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.
Diff: main.cpp
- Revision:
- 13:ddff4bb7c24f
- Parent:
- 9:7b9094864268
- Child:
- 14:12fb3e326911
--- a/main.cpp Thu Oct 06 11:32:01 2022 +0000 +++ b/main.cpp Thu Oct 06 12:10:51 2022 +0000 @@ -15,6 +15,8 @@ // Prototypes int PitTest(void); // Test if to robot needs to goto pit void InitialMessages (void); // Prints initial message to the LCD +void LED_Control(int ledNumber, int state) //turn ledNumber to 1=on, 0 = off + int main() { m3pi.sensor_auto_calibrate(); @@ -112,7 +114,7 @@ DigitalOut led1(LED1); led1 = 0; // Turn off led 1 on the embed - /*Test if the voltage is below the treshold if so turn on go to pit mode*/ + /*Test if the voltage is below the threshold if so turn on go to pit mode*/ if (m3pi.battery() <= BATVOLTTRESHOLD ()){ result = 1; // Set goto pit condition led1 = 1; // Turn on Led 1 @@ -123,4 +125,20 @@ m3pi.printf("PIT Party"); } return result; +} + +void LED_Control(int ledNumber, int state){ + //LED1 on if robot is looking for pit + if ledNumber == 1{ + DigitalOut led1(state); + } + if ledNumber == 2{ + DigitalOut led1(state); + } + if ledNumber == 3{ + DigitalOut led1(state); + } + if ledNumber == 4{ + DigitalOut led1(state); + } } \ No newline at end of file