bot.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef LIBBOT_H
00029 #define LIBBOT_H
00030
00031 #define DIGITAL_PORT *(unsigned char volatile *)0x7000
00032 #define MAXSPEED 30
00033 #define MINSPEED -30
00034 #define LEFT_MTR 0x10
00035 #define RIGHT_MTR 0x40
00036 #define LEFT_REVERSE 0x01
00037 #define RIGHT_REVERSE 0x04
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 #define DSW1 0x8000
00054 #define DSW2 0x4000
00055 #define DSW3 0x2000
00056 #define DSW4 0x1000
00057
00058 #define SERVO 0x100
00059 #define IR 0x20
00060 #define BUMPER 0x10
00061 #define ACTIVE 0x08
00062 #define PLIR 0x04
00063 #define PHOTO 0x02
00064 #define STATUS 0x01
00065
00066
00067 #define DIP1 analog[16]
00068 #define DIP2 analog[17]
00069 #define DIP3 analog[18]
00070 #define DIP4 analog[19]
00071 #define FROB1 analog[20]
00072 #define FROB2 analog[15]
00073
00074 #define PHOTOL analog[0]
00075 #define PHOTOR analog[1]
00076
00077 extern char *sprintf();
00078 extern void init_buffered_io();
00079 extern unsigned char sci_putc(char);
00080 extern unsigned char sci_getc();
00081 extern int serial_print();
00082 extern unsigned char chk_serial_inbuf();
00083 extern void init_sysclock(void);
00084 extern long sysclock;
00085 extern void init_analog (void);
00086 extern unsigned char read_analog (unsigned char);
00087 extern volatile unsigned char analog[];
00088 extern void init_encoders();
00089 extern volatile int l_encoder, Lticks, r_encoder, Rticks;
00090 extern volatile char c_encoder;
00091 extern void init_ir();
00092 extern volatile int ir_detect_lt, ir_detect_rt;
00093 extern void init_poll_sensors();
00094 extern volatile int Detect, Bcount;
00095 extern void start_speed_ctl(), stop_speed_ctl();
00096 extern void init_pwm(void);
00097 extern volatile int Lspeed, Rspeed, Lmtr, Rmtr, av_velo, run_speed;
00098 extern volatile unsigned char digital_shadowbits, expbd_shadowbits;
00099 extern unsigned char choose_button(), escape_button();
00100 extern volatile unsigned short le_sample, re_sample;
00101 extern void pwm_on(void), pwm_off(void);
00102 extern void speed_ctl();
00103 extern void led0_on(), led1_on(), led0_off(), led1_off();
00104
00105 #endif
|