Testing 1 blue pill

Dependencies:   mbed mbed-rtos TextLCD

Committer:
thomasmorris
Date:
Thu Apr 04 10:52:22 2019 +0000
Revision:
30:a35f0ab97a65
Parent:
29:f3b1387c81f1
Testing 1;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
thomasmorris 12:d9c133b360b0 1 #ifndef SETUP_HPP//Header Guards Prevents Multiple includes
thomasmorris 12:d9c133b360b0 2 #define SETUP_HPP
thomasmorris 25:9751619fa030 3
thomasmorris 13:c681f340909b 4 #include "stdio.h"
thomasmorris 13:c681f340909b 5 #include "string.h"
thomasmorris 13:c681f340909b 6 #include "mbed.h"
thomasmorris 13:c681f340909b 7 #include "rtos.h"
thomasmorris 13:c681f340909b 8 #include "TextLCD.h"
thomasmorris 13:c681f340909b 9 #include "iostream"
thomasmorris 12:d9c133b360b0 10 #include "rtos.h"
thomasmorris 16:9f98ec0ededb 11 #include "STEPPER_MOTOR.hpp"
thomasmorris 16:9f98ec0ededb 12 #include "Interface.hpp"
thomasmorris 23:07a368f2cdb1 13
thomasmorris 29:f3b1387c81f1 14 #define Debounce_Time 300//200 works fine
thomasmorris 29:f3b1387c81f1 15 #define Up_Down_Debounce_Time 300
thomasmorris 25:9751619fa030 16 INTERFACE INTERFACE;
thomasmorris 16:9f98ec0ededb 17
thomasmorris 13:c681f340909b 18 //Digital Outputs
thomasmorris 13:c681f340909b 19 DigitalOut led1(LED1);
thomasmorris 13:c681f340909b 20 DigitalOut led2(LED2);
thomasmorris 21:6d9f6a986647 21
thomasmorris 25:9751619fa030 22
thomasmorris 25:9751619fa030 23 //Function forward declarations
thomasmorris 14:63998be3d43c 24 void up_thread_function();
thomasmorris 14:63998be3d43c 25 void down_thread_function();
thomasmorris 14:63998be3d43c 26 void start_thread_function();
thomasmorris 14:63998be3d43c 27 void function_thread_function();
thomasmorris 14:63998be3d43c 28 void select_thread_function();
thomasmorris 26:83550fc299aa 29 void Polling_thread_function();
thomasmorris 13:c681f340909b 30 //Thread Setups
thomasmorris 26:83550fc299aa 31 Thread polling_thread;
thomasmorris 13:c681f340909b 32 Thread lcd_thread;
thomasmorris 13:c681f340909b 33 Thread led_thread;
thomasmorris 14:63998be3d43c 34 Thread up_thread;
thomasmorris 14:63998be3d43c 35 Thread down_thread;
thomasmorris 14:63998be3d43c 36 Thread start_stop_thread;
thomasmorris 14:63998be3d43c 37 Thread function_thread;
thomasmorris 14:63998be3d43c 38 Thread select_thread;
thomasmorris 30:a35f0ab97a65 39 Thread Interface_Serial_thread;
thomasmorris 17:68b3fdabe4c5 40 //LCD pin connections
thomasmorris 17:68b3fdabe4c5 41 TextLCD lcd(D0,D1,D4,D5,D6,D7); // rs, e, d4-d7
thomasmorris 14:63998be3d43c 42
thomasmorris 17:68b3fdabe4c5 43 //Serial Terminal setup for debugging
thomasmorris 13:c681f340909b 44 Serial pc(USBTX, USBRX); //Define serial namespace so the serial comms can be printed to
thomasmorris 23:07a368f2cdb1 45
thomasmorris 29:f3b1387c81f1 46 int Down_Counter = 0;
thomasmorris 29:f3b1387c81f1 47 int Up_Counter = 0;
thomasmorris 29:f3b1387c81f1 48
JDickson 27:22d6fd88828e 49 #endif