Testing 1 blue pill

Dependencies:   mbed mbed-rtos TextLCD

Committer:
thomasmorris
Date:
Mon Feb 11 22:03:47 2019 +0000
Revision:
16:9f98ec0ededb
Parent:
14:63998be3d43c
Child:
17:68b3fdabe4c5
Class Structure interface

Who changed what in which revision?

UserRevisionLine numberNew contents of line
thomasmorris 12:d9c133b360b0 1 /*
thomasmorris 12:d9c133b360b0 2 Setup file for the main
thomasmorris 12:d9c133b360b0 3 */
thomasmorris 12:d9c133b360b0 4
thomasmorris 12:d9c133b360b0 5 #ifndef SETUP_HPP//Header Guards Prevents Multiple includes
thomasmorris 12:d9c133b360b0 6 #define SETUP_HPP
thomasmorris 13:c681f340909b 7 #include "stdio.h"
thomasmorris 13:c681f340909b 8 #include "string.h"
thomasmorris 13:c681f340909b 9 #include "mbed.h"
thomasmorris 13:c681f340909b 10 #include "rtos.h"
thomasmorris 13:c681f340909b 11 #include "TextLCD.h"
thomasmorris 13:c681f340909b 12 #include "iostream"
thomasmorris 12:d9c133b360b0 13 //Libraries and header includes
thomasmorris 12:d9c133b360b0 14 #include "rtos.h"
thomasmorris 16:9f98ec0ededb 15 #include "STEPPER_MOTOR.hpp"
thomasmorris 16:9f98ec0ededb 16 #include "Interface.hpp"
thomasmorris 12:d9c133b360b0 17
thomasmorris 16:9f98ec0ededb 18 InterruptIn button_up(D8); //D8//Increment Button
thomasmorris 16:9f98ec0ededb 19 InterruptIn button_down(A1); //A1//Decrement Button
thomasmorris 16:9f98ec0ededb 20 InterruptIn button_start(D9); //D9//START / STOP BUTTON
thomasmorris 16:9f98ec0ededb 21 InterruptIn button_funct(A3); //A3//Function Button
thomasmorris 16:9f98ec0ededb 22 InterruptIn button_select(A4);//A4//Select Button
thomasmorris 16:9f98ec0ededb 23
thomasmorris 13:c681f340909b 24 //Digital Outputs
thomasmorris 13:c681f340909b 25 DigitalOut led1(LED1);
thomasmorris 13:c681f340909b 26 DigitalOut led2(LED2);
thomasmorris 14:63998be3d43c 27 void up_thread_function();
thomasmorris 14:63998be3d43c 28 void down_thread_function();
thomasmorris 14:63998be3d43c 29 void start_thread_function();
thomasmorris 14:63998be3d43c 30 void function_thread_function();
thomasmorris 14:63998be3d43c 31 void select_thread_function();
thomasmorris 14:63998be3d43c 32
thomasmorris 13:c681f340909b 33 //Thread Setups
thomasmorris 13:c681f340909b 34 Thread lcd_thread;
thomasmorris 13:c681f340909b 35 Thread led_thread;
thomasmorris 14:63998be3d43c 36 Thread up_thread;
thomasmorris 14:63998be3d43c 37 Thread down_thread;
thomasmorris 14:63998be3d43c 38 Thread start_stop_thread;
thomasmorris 14:63998be3d43c 39 Thread function_thread;
thomasmorris 14:63998be3d43c 40 Thread select_thread;
thomasmorris 14:63998be3d43c 41
thomasmorris 13:c681f340909b 42 TextLCD lcd(D0,D1,D4,D5,D6,D7); // rs, e, d4-d7
thomasmorris 13:c681f340909b 43 Serial pc(USBTX, USBRX); //Define serial namespace so the serial comms can be printed to
thomasmorris 13:c681f340909b 44
thomasmorris 12:d9c133b360b0 45 #endif