Marie-Laure Snijders / Mbed 2 deprecated Demo_mode

Dependencies:   BioroboticsMotorControl mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "motor.h"
00003 #include "Screen.h"
00004 
00005 InterruptIn Button1(D2);            // Right button on interface
00006 InterruptIn Button2(D3);            // Left button on interface
00007 InterruptIn Panic_button(D8);       // Red button on interface
00008 Screen screen(D14, D15, D9);        // Screen interface
00009 Motor main_motor(D6, D7, D13, D12);
00010 Motor sec_motor(D5, D4, D10, D11);
00011 
00012 void ()
00013 
00014 
00015 
00016 int main()
00017 {
00018     while (true) 
00019     {
00020         screen.clear_display();
00021         screen.display_state_name("Demo mode");
00022         
00023         control_goes_up = true;
00024         control_goes_right = true;
00025         
00026         screen.display_up_down_arrow(control_goes_up);
00027         screen.display_left_right_arrow(control_goes_right);
00028         screen.display();
00029         
00030         Button1.fall();
00031         Button2.fall();
00032 
00033         if (p_button.is_pressed()) {                            // For panic state
00034         current_state = failure;}
00035 
00036 
00037     }
00038 }