Working Start + stop code
Dependencies: mbed mbed-rtos TextLCD
SETUP.hpp
00001 #ifndef SETUP_HPP//Header Guards Prevents Multiple includes 00002 #define SETUP_HPP 00003 00004 #include "stdio.h" 00005 #include "string.h" 00006 #include "mbed.h" 00007 #include "rtos.h" 00008 #include "TextLCD.h" 00009 #include "iostream" 00010 #include "rtos.h" 00011 #include "STEPPER_MOTOR.hpp" 00012 #include "Interface.hpp" 00013 00014 #define Debounce_Time 100//200 works fine 00015 INTERFACE INTERFACE; 00016 //If the code compiles GET IN THE BIN 00017 00018 00019 //Digital Outputs 00020 DigitalOut led1(LED1); 00021 DigitalOut led2(LED2); 00022 00023 00024 //Function forward declarations 00025 void up_thread_function(); 00026 void down_thread_function(); 00027 void start_thread_function(); 00028 void function_thread_function(); 00029 void select_thread_function(); 00030 void Polling_thread_function(); 00031 //Thread Setups 00032 Thread polling_thread; 00033 Thread lcd_thread; 00034 Thread led_thread; 00035 Thread up_thread; 00036 Thread down_thread; 00037 Thread start_stop_thread; 00038 Thread function_thread; 00039 Thread select_thread; 00040 //LCD pin connections 00041 TextLCD lcd(D0,D1,D4,D5,D6,D7); // rs, e, d4-d7 00042 00043 //Serial Terminal setup for debugging 00044 Serial pc(USBTX, USBRX); //Define serial namespace so the serial comms can be printed to 00045 00046 #endif 00047 00048 //Useful information 00049 /* 00050 Function 0 = Turn 00051 Function 1 = Anneal 00052 Function 2 = Test 00053 00054 Black :Reset : HardWired 00055 Red :Up : D8 00056 Orange:Down : A1 00057 Brown :Start/Stop: D9 00058 Green :Select : A3 00059 Yellow:Function : A4 00060 00061 00062 //Led Outputs //check the pin outs. 00063 static DigitalOut Led_Select_Left(D2); 00064 static DigitalOut Led_Select_Right(D3); 00065 static DigitalOut Led_Power(A3); 00066 00067 TextLCD lcd(D0,D1,D4,D5,D6,D7); // rs, e, d4-d7 00068 TendonPower (PWM) pin is PE_8 one below d0 00069 STEPPER_MOTOR STEPPER_MOTOR_1(D15,D14,D13,D12) this is defined in interface.hpp 00070 */ 00071
Generated on Wed Jul 13 2022 20:03:02 by
1.7.2