#include <WProgram.h>
#include <Wire.h>
#include <Servo.h>
#include <CapSense.h>
Go to the source code of this file.
Defines | |
#define | BUTTON1 A6 |
#define | BUTTON2 A7 |
#define | BUTTON3 A8 |
#define | JOY_I2C_ADDR 0x40 |
#define | JOY_nINT A10 |
#define | JOY_nRESET A11 |
#define | JOY_SWITCH A9 |
#define | LED1_BLUE 9 |
#define | LED1_GREEN 10 |
#define | LED1_RED 8 |
#define | LED2_BLUE 6 |
#define | LED2_GREEN 7 |
#define | LED2_RED 5 |
#define | LED3_BLUE 3 |
#define | LED3_GREEN 4 |
#define | LED3_RED 2 |
#define | LIGHT_SENSOR A2 |
#define | RELAY1 A0 |
#define | RELAY2 A1 |
#define | SERVO1 11 |
#define | SERVO2 12 |
#define | SERVO3 13 |
#define | TEMP_SENSOR A3 |
#define | TOUCH_RECV 14 |
#define | TOUCH_SEND 15 |
Functions | |
void | calibrate_joystick (int dz) |
void | init_buttons () |
void | init_joystick (int threshold) |
void | init_leds () |
void | init_relays () |
char | joystick_interrupt () |
char | read_joy_reg (char reg_addr) |
void | read_joystick (int *x, int *y) |
void | setup_shield () |
void | write_joy_reg (char reg_addr, char val) |
Variables | |
int | offset_X |
int | offset_Y |
bool | prior_robot_state |
Servo | servos [3] |
CapSense | touch_robot = CapSense(TOUCH_SEND, TOUCH_RECV) |
#define BUTTON1 A6 |
Definition at line 35 of file adk_shield.h.
#define BUTTON2 A7 |
Definition at line 36 of file adk_shield.h.
#define BUTTON3 A8 |
Definition at line 37 of file adk_shield.h.
#define JOY_I2C_ADDR 0x40 |
Definition at line 101 of file adk_shield.h.
#define JOY_nINT A10 |
Definition at line 40 of file adk_shield.h.
#define JOY_nRESET A11 |
Definition at line 41 of file adk_shield.h.
#define JOY_SWITCH A9 |
Definition at line 39 of file adk_shield.h.
#define LED1_BLUE 9 |
Definition at line 20 of file adk_shield.h.
#define LED1_GREEN 10 |
Definition at line 19 of file adk_shield.h.
#define LED1_RED 8 |
Definition at line 18 of file adk_shield.h.
#define LED2_BLUE 6 |
Definition at line 16 of file adk_shield.h.
#define LED2_GREEN 7 |
Definition at line 15 of file adk_shield.h.
#define LED2_RED 5 |
Definition at line 14 of file adk_shield.h.
#define LED3_BLUE 3 |
Definition at line 12 of file adk_shield.h.
#define LED3_GREEN 4 |
Definition at line 11 of file adk_shield.h.
#define LED3_RED 2 |
Definition at line 10 of file adk_shield.h.
#define LIGHT_SENSOR A2 |
Definition at line 32 of file adk_shield.h.
#define RELAY1 A0 |
Definition at line 29 of file adk_shield.h.
#define RELAY2 A1 |
Definition at line 30 of file adk_shield.h.
#define SERVO1 11 |
Definition at line 22 of file adk_shield.h.
#define SERVO2 12 |
Definition at line 23 of file adk_shield.h.
#define SERVO3 13 |
Definition at line 24 of file adk_shield.h.
#define TEMP_SENSOR A3 |
Definition at line 33 of file adk_shield.h.
#define TOUCH_RECV 14 |
Definition at line 26 of file adk_shield.h.
#define TOUCH_SEND 15 |
Definition at line 27 of file adk_shield.h.
void calibrate_joystick | ( | int | dz | ) |
Definition at line 135 of file adk_shield.h.
void init_buttons | ( | ) |
Definition at line 48 of file adk_shield.h.
void init_joystick | ( | int | threshold | ) |
Definition at line 172 of file adk_shield.h.
void init_leds | ( | ) |
Definition at line 71 of file adk_shield.h.
void init_relays | ( | ) |
Definition at line 64 of file adk_shield.h.
char joystick_interrupt | ( | ) |
Definition at line 127 of file adk_shield.h.
char read_joy_reg | ( | char | reg_addr | ) |
Definition at line 103 of file adk_shield.h.
void read_joystick | ( | int * | x, |
int * | y | ||
) |
Definition at line 207 of file adk_shield.h.
void setup_shield | ( | ) |
Definition at line 215 of file adk_shield.h.
void write_joy_reg | ( | char | reg_addr, |
char | val | ||
) |
Definition at line 119 of file adk_shield.h.
int offset_X |
Definition at line 133 of file adk_shield.h.
int offset_Y |
Definition at line 133 of file adk_shield.h.
bool prior_robot_state |
Definition at line 45 of file adk_shield.h.
Servo servos[3] |
Definition at line 213 of file adk_shield.h.
CapSense touch_robot = CapSense(TOUCH_SEND, TOUCH_RECV) |
Definition at line 44 of file adk_shield.h.