/* * Title: Switches * * Author: Blake C. Sutton * * Purpose: This is a set of functions used to test and read input from * at least one switches connected to a port on the Mavric IIB. * The main will read in the switch value and display a value on the LCD * accordingly. * */ #ifndef __Switches__ #define __Switches__ #include "LCD_Routines.h" //Defines switches by a mask identifying which bit they are //This way switch values can be accessed with front_right, etc. #define front_right (0x80) #define front_left (0x40) #define back_right (0x20) #define back_left (0x10) //Sets up port needed for switches void init_switches(void); //Returns an int indicating if the switch is on or not. //If = 1, logical 1 is on the switch, else 0 //Parameters: switch_id -- one of the switch identifiers defined above uint8_t get_switch_value(uint8_t switch_id); //Main program is a test function to display values of the switches //on the LCD screen in real time. Use this to calibrate switches so //all are the same value when pressed / not pressed. //Comment out main function to use with other modules. #endif