![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ft. button press reset
Fork of BeaconDemo_RobotCode by
main.h@6:ff3c66f7372b, 2015-10-22 (annotated)
- Committer:
- jah128
- Date:
- Thu Oct 22 00:46:14 2015 +0000
- Revision:
- 6:ff3c66f7372b
- Parent:
- 0:8a5497a2e366
- Child:
- 7:ef9ab01b9e26
Initial version: beacon detection and sync. code, bearing estimation.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jah128 | 0:8a5497a2e366 | 1 | /*********************************************************************** |
jah128 | 0:8a5497a2e366 | 2 | ** ██████╗ ███████╗██╗███████╗██╗ ██╗ █████╗ ██████╗ ███╗ ███╗ ** |
jah128 | 0:8a5497a2e366 | 3 | ** ██╔══██╗██╔════╝██║██╔════╝██║ ██║██╔══██╗██╔══██╗████╗ ████║ ** |
jah128 | 0:8a5497a2e366 | 4 | ** ██████╔╝███████╗██║███████╗██║ █╗ ██║███████║██████╔╝██╔████╔██║ ** |
jah128 | 0:8a5497a2e366 | 5 | ** ██╔═══╝ ╚════██║██║╚════██║██║███╗██║██╔══██║██╔══██╗██║╚██╔╝██║ ** |
jah128 | 0:8a5497a2e366 | 6 | ** ██║ ███████║██║███████║╚███╔███╔╝██║ ██║██║ ██║██║ ╚═╝ ██║ ** |
jah128 | 0:8a5497a2e366 | 7 | ** ╚═╝ ╚══════╝╚═╝╚══════╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ** |
jah128 | 0:8a5497a2e366 | 8 | ************************************************************************ |
jah128 | 0:8a5497a2e366 | 9 | **(C) Dr James Hilder - York Robotics Laboratory - University of York ** |
jah128 | 0:8a5497a2e366 | 10 | ***********************************************************************/ |
jah128 | 0:8a5497a2e366 | 11 | |
jah128 | 6:ff3c66f7372b | 12 | /// PsiSwarm Beautiful Meme Project Source Code |
jah128 | 6:ff3c66f7372b | 13 | /// Version 0.1 |
jah128 | 6:ff3c66f7372b | 14 | /// James Hilder, Alan Millard, Homero Elizondo, Jon Timmis |
jah128 | 6:ff3c66f7372b | 15 | /// University of York |
jah128 | 6:ff3c66f7372b | 16 | |
jah128 | 6:ff3c66f7372b | 17 | #ifndef MAIN_H |
jah128 | 6:ff3c66f7372b | 18 | #define MAIN_H |
jah128 | 6:ff3c66f7372b | 19 | |
jah128 | 6:ff3c66f7372b | 20 | #include "beacon.h" |
jah128 | 6:ff3c66f7372b | 21 | |
jah128 | 6:ff3c66f7372b | 22 | extern char beacon_found; // This will be a 1 if beacon is detected, 0 if it isn't |
jah128 | 6:ff3c66f7372b | 23 | extern int beacon_heading; // The heading from the last time the beacon was detected |
jah128 | 6:ff3c66f7372b | 24 | extern char robots_found[8]; // These will be a 1 when the respective robot [excluding self] was detected during the previous 500ms window |
jah128 | 6:ff3c66f7372b | 25 | extern char robots_heading[8]; // These are the headings from the last time the respective robots were detected |
jah128 | 6:ff3c66f7372b | 26 | extern unsigned short robots_distance[8]; // This is the maximum sensor value from the last time the respective robot was detected |
jah128 | 6:ff3c66f7372b | 27 | extern unsigned short reflected_sensor_data[8]; // The reflected IR values when this robots emitters are on |
jah128 | 6:ff3c66f7372b | 28 | extern unsigned short background_sensor_data[8];// The raw IR values when no robot (or beacon) should have its IR on |
jah128 | 6:ff3c66f7372b | 29 | |
jah128 | 0:8a5497a2e366 | 30 | void user_code_setup(void); |
jah128 | 0:8a5497a2e366 | 31 | void user_code_loop(void); |
jah128 | 0:8a5497a2e366 | 32 | void handle_switch_event(char switch_state); |
jah128 | 6:ff3c66f7372b | 33 | int main(void); |
jah128 | 6:ff3c66f7372b | 34 | |
jah128 | 6:ff3c66f7372b | 35 | |
jah128 | 6:ff3c66f7372b | 36 | void display_ir_readings(void); |
jah128 | 6:ff3c66f7372b | 37 | void out(const char* format, ...) ; |
jah128 | 6:ff3c66f7372b | 38 | |
jah128 | 6:ff3c66f7372b | 39 | #endif |