Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 176 → Rev 177

/avr/bioloid-foot/bioloidFoot.h
44,14 → 44,14
#define MAX_EEPROM_ENTRY 23
 
#define CONTROL_LED 25
#define CONTROL_FRONT_LEFT_LOW 26
#define CONTROL_FRONT_LEFT_HIGH 27
#define CONTROL_FRONT_RIGHT_LOW 28
#define CONTROL_FRONT_RIGHT_HIGH 29
#define CONTROL_REAR_LEFT_LOW 30
#define CONTROL_REAR_LEFT_HIGH 31
#define CONTROL_REAR_RIGHT_LOW 32
#define CONTROL_REAR_RIGHT_HIGH 33
#define CONTROL_FRONT_INSIDE_LOW 26
#define CONTROL_FRONT_INSIDE_HIGH 27
#define CONTROL_FRONT_OUTSIDE_LOW 28
#define CONTROL_FRONT_OUTSIDE_HIGH 29
#define CONTROL_REAR_INSIDE_LOW 30
#define CONTROL_REAR_INSIDE_HIGH 31
#define CONTROL_REAR_OUTSIDE_LOW 32
#define CONTROL_REAR_OUTSIDE_HIGH 33
 
#define NUM_PRESSURE_CONTROL_ENTRIES 34
#define MAX_PRESSURE_CONTROL_ENTRY 33
88,9 → 88,9
#define ADC_ROLL_RATE_CHANNEL 7
#define ADC_YAW_RATE_CHANNEL 3
 
#define PRESSURE_FRONT_RIGHT_CHANNEL 3
#define PRESSURE_FRONT_LEFT_CHANNEL 0
#define PRESSURE_REAR_LEFT_CHANNEL 1
#define PRESSURE_REAR_RIGHT_CHANNEL 2
#define PRESSURE_FRONT_INSIDE_CHANNEL 3
#define PRESSURE_FRONT_OUTSIDE_CHANNEL 4
#define PRESSURE_REAR_INSIDE_CHANNEL 2
#define PRESSURE_REAR_OUTSIDE_CHANNEL 5
 
#endif /* BIOLOID_FOOT_H */
/avr/bioloid-foot/bioloidFoot.c
37,7 → 37,7
 
#define LED_DDR DDRD
#define LED_PORT PORTD
#define LED_MASK (1 << 3)
#define LED_MASK (1 << 5)
 
/* ---- Private Variables ------------------------------------------------ */
 
104,7 → 104,7
// NOTE - These are the hardware defaults...
gControlTable [CONTROL_MODEL_NUMBER_LOW] = 11;
gControlTable [CONTROL_MODEL_NUMBER_HIGH] = 67;
gControlTable [CONTROL_FIRMWARE_VERSION] = 1;
gControlTable [CONTROL_FIRMWARE_VERSION] = 2;
gControlTable [CONTROL_ID] = 121;
gControlTable [CONTROL_BAUD_RATE] = 1;
gControlTable [CONTROL_RETURN_DELAY_TIME] = 250;
409,21 → 409,21
{
uint16_t value;
 
value = ADC_Read (PRESSURE_FRONT_RIGHT_CHANNEL);
gControlTable [CONTROL_FRONT_RIGHT_LOW] = (value & 0xFF);
gControlTable [CONTROL_FRONT_RIGHT_HIGH] = (value >> 8);
value = ADC_Read (PRESSURE_FRONT_OUTSIDE_CHANNEL);
gControlTable [CONTROL_FRONT_OUTSIDE_LOW] = (value & 0xFF);
gControlTable [CONTROL_FRONT_OUTSIDE_HIGH] = (value >> 8);
 
value = ADC_Read (PRESSURE_FRONT_LEFT_CHANNEL);
gControlTable [CONTROL_FRONT_LEFT_LOW] = (value & 0xFF);
gControlTable [CONTROL_FRONT_LEFT_HIGH] = (value >> 8);
value = ADC_Read (PRESSURE_FRONT_INSIDE_CHANNEL);
gControlTable [CONTROL_FRONT_INSIDE_LOW] = (value & 0xFF);
gControlTable [CONTROL_FRONT_INSIDE_HIGH] = (value >> 8);
 
value = ADC_Read (PRESSURE_REAR_LEFT_CHANNEL);
gControlTable [CONTROL_REAR_LEFT_LOW] = (value & 0xFF);
gControlTable [CONTROL_REAR_LEFT_HIGH] = (value >> 8);
value = ADC_Read (PRESSURE_REAR_INSIDE_CHANNEL);
gControlTable [CONTROL_REAR_INSIDE_LOW] = (value & 0xFF);
gControlTable [CONTROL_REAR_INSIDE_HIGH] = (value >> 8);
 
value = ADC_Read (PRESSURE_REAR_RIGHT_CHANNEL);
gControlTable [CONTROL_REAR_RIGHT_LOW] = (value & 0xFF);
gControlTable [CONTROL_REAR_RIGHT_HIGH] = (value >> 8);
value = ADC_Read (PRESSURE_REAR_OUTSIDE_CHANNEL);
gControlTable [CONTROL_REAR_OUTSIDE_LOW] = (value & 0xFF);
gControlTable [CONTROL_REAR_OUTSIDE_HIGH] = (value >> 8);
}
 
 
473,8 → 473,8
LED_PORT &= ~LED_MASK;
 
Log ("*****\n");
Log ("***** Bioloid Foot Pressure Sensor\n");
Log ("***** Copyright 2007 HUVrobotics\n");
Log ("***** Bioloid Foot Pressure Sensor (Rev. 2)\n");
Log ("***** Copyright 2008 HUVrobotics\n");
Log ("*****\n");
 
while (1) // outer loop is once every 10 ms
/avr/bioloid-foot/Config.h
19,9 → 19,9
#define CFG_TIMER_UART_TX_BUFFER_SIZE 64
#define CFG_TIMER_UART_BAUD_RATE 19200
#define CFG_TIMER_UART_LF_TO_CRLF 1
#define CFG_TIMER_UART_DDR DDRB
#define CFG_TIMER_UART_PORT PORTB
#define CFG_TIMER_UART_MASK ( 1 << 7 )
#define CFG_TIMER_UART_DDR DDRD
#define CFG_TIMER_UART_PORT PORTD
#define CFG_TIMER_UART_MASK ( 1 << 4 )
 
#define CFG_LOG_TO_BUFFER 1
#define CFG_LOG_NUM_BUFFER_ENTRIES 32