diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-06-08 11:41:26 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-06-08 11:41:26 +0200 |
commit | 29f1a90f8cf07bffa9b53c9994cb9f2698fce920 (patch) | |
tree | e901c6ffd0028dacc8bdafd192fa0b30a4332c9f /robot/mode_grid.h | |
parent | 932f46a1f0b7e3ed99bbfc901dad80e2636cd9e4 (diff) |
WIP merge
Diffstat (limited to 'robot/mode_grid.h')
-rw-r--r-- | robot/mode_grid.h | 92 |
1 files changed, 14 insertions, 78 deletions
diff --git a/robot/mode_grid.h b/robot/mode_grid.h index b13cc4c..c8e649f 100644 --- a/robot/mode_grid.h +++ b/robot/mode_grid.h @@ -7,87 +7,23 @@ * * processes orders from the order buffer */ +void w2_mode_grid(); -enum orientation{ - North, - East, - South, - West -} direction; - -typedef struct { - int x; - int y; -} coordinates; - -coordinates order[4]; -coordinates location; -coordinates destination; - -char xLocation; -char yLocation; - -//LINE 25-68 CAN BE TAKEN AWAY WHEN USED WITH MODE_MAZE - -// The 3pi include file must be at the beginning of any program that -// uses the Pololu AVR library and 3pi. -#include <pololu/3pi.h> - -// This include file allows data to be stored in program space. The -// ATmega168 has 16k of program space compared to 1k of RAM, so large -// pieces of static data should be stored in program space. -#include <avr/pgmspace.h> +void w2_crosswalk_detection(); -unsigned int sensors[5]; // an array to hold sensor values -unsigned int position; -// Introductory messages. The "PROGMEM" identifier causes the data to -// go into program space. -const char welcome_line1[] PROGMEM = " Pololu"; -const char welcome_line2[] PROGMEM = "3\xf7 Robot"; -const char demo_name_line1[] PROGMEM = "PID Line"; -const char demo_name_line2[] PROGMEM = "follower"; +typedef enum { + W2_ORT_NORTH, + W2_ORT_EAST, + W2_ORT_SOUTH, + W2_ORT_WEST +} w2_e_orientation; -// A couple of simple tunes, stored in program space. -const char welcome[] PROGMEM = ">g32>>c32"; -const char go[] PROGMEM = "L16 cdegreg4"; +// enum w2_e_section { mazeMode, gridMode, chargeMode } g_w2_parcour_mode; -// Data for generating the characters used in load_custom_characters -// and display_readings. By reading levels[] starting at various -// offsets, we can generate all of the 7 extra characters needed for a -// bargraph. This is also stored in program space. -const char levels[] PROGMEM = { - 0b00000, - 0b00000, - 0b00000, - 0b00000, - 0b00000, - 0b00000, - 0b00000, - 0b11111, - 0b11111, - 0b11111, - 0b11111, - 0b11111, - 0b11111, - 0b11111 -}; +typedef struct { + int x; + int y; +} w2_s_grid_coordinate; -void w2_mode_grid(); -void initialize(); -void full_rotation(); -void grid_rotation_left(); -void grid_rotation_right(); -void grid_crossway_detection(); -void gridFollowLine(); -void orderOne(); -void orderTwo(); -void orderThree(); -void orderFour(); -void beginLocation(); -void turn_North(); -void turn_West(); -void turn_South(); -void turn_East(); -void locationMessage(); -void arrivedMessage(); +extern w2_s_grid_coordinate g_w2_order[4]; |