ADD bike-system super-loop with while
This commit is contained in:
		
							
								
								
									
										19
									
								
								main.cpp
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								main.cpp
									
									
									
									
									
								
							| @@ -6,19 +6,28 @@ | ||||
| #if !MBED_TEST_MODE | ||||
|  | ||||
| #include "mbed.h"  // NOLINT | ||||
| #include "mbed_trace.h" | ||||
| #include "static_scheduling/bike_system.hpp" | ||||
|  | ||||
| // Blinking rate in milliseconds | ||||
| #define BLINKING_RATE 500ms | ||||
|  | ||||
| #define TRACE_GROUP "MAIN" | ||||
|  | ||||
| int main() { | ||||
|     // Initialise the digital pin LED1 as an output | ||||
|  | ||||
|     DigitalOut led(LED1); | ||||
|     mbed_trace_init(); | ||||
|     // DigitalOut led(LED1); | ||||
|     // tr_debug("Hello world"); | ||||
|  | ||||
|     while (true) { | ||||
|         led = !led; | ||||
|         ThisThread::sleep_for(BLINKING_RATE); | ||||
|     } | ||||
|     //    while (true) { | ||||
|     //        led = !led; | ||||
|     //        ThisThread::sleep_for(BLINKING_RATE); | ||||
|     //        tr_debug("blink"); | ||||
|     //    } | ||||
|     static_scheduling::BikeSystem bikeSystem; | ||||
|     bikeSystem.start(); | ||||
| } | ||||
|  | ||||
| #endif  // MBED_TEST_MODE | ||||
|   | ||||
		Reference in New Issue
	
	Block a user