summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormeyma <devnull@localhost>2007-02-22 15:27:02 +0100
committermeyma <devnull@localhost>2007-02-22 15:27:02 +0100
commitdc8b1cde313f3f8a60462187bbeeea4277fd0313 (patch)
tree02c427d6089d7d9c9b10197ca527ff5d561d82f9
parentd7ac8f546afb75bd2d626b5cc639939337560cf6 (diff)
downloadrc2007-soccer-dc8b1cde313f3f8a60462187bbeeea4277fd0313.tar
rc2007-soccer-dc8b1cde313f3f8a60462187bbeeea4277fd0313.zip
Additional Codework on Distance_Sensor
-rwxr-xr-xsource/Concept/Framework/atmega128io.c4
-rwxr-xr-xsource/Concept/Framework/modules/input/distance_sensor.h5
-rwxr-xr-xsource/Concept/Framework/robot.c5
3 files changed, 10 insertions, 4 deletions
diff --git a/source/Concept/Framework/atmega128io.c b/source/Concept/Framework/atmega128io.c
index 94e0f94..e077a98 100755
--- a/source/Concept/Framework/atmega128io.c
+++ b/source/Concept/Framework/atmega128io.c
@@ -595,8 +595,8 @@ void uart1_puts_p(const char *progmem_s )
int8 Init_TWI(void){
TWAR = OWN_ADR; /*!< Eigenen Slave Adresse setzen */
- TWBR = 12; /*!< Setze Baudrate auf 100 KHz */
- /*!< 4 MHz xtal */
+ TWBR = 64; /*!< Setze Baudrate auf 100 KHz */
+ /*!< 16 MHz xtal */
TWCR = (1<<TWEN); /*!< TWI-Interface einschalten */
return 1;
diff --git a/source/Concept/Framework/modules/input/distance_sensor.h b/source/Concept/Framework/modules/input/distance_sensor.h
index 9efa021..9fb2c58 100755
--- a/source/Concept/Framework/modules/input/distance_sensor.h
+++ b/source/Concept/Framework/modules/input/distance_sensor.h
@@ -50,7 +50,10 @@ public:
default:
this->slaveAddr = 0;
break;
- }
+ }
+
+ // initialiate the sensor
+ srf10_init();
}
protected:
diff --git a/source/Concept/Framework/robot.c b/source/Concept/Framework/robot.c
index 0e4e9ac..9985463 100755
--- a/source/Concept/Framework/robot.c
+++ b/source/Concept/Framework/robot.c
@@ -42,7 +42,10 @@ Robot::Robot()
TCCR3B = (1<<ICNC3) | (1<<CS31); // set clock/prescaler 1/8 -> enable counter
//Activate interrupt
- sei();
+ sei();
+
+ // Initialiate TWI
+ Init_TWI();
//Interface
for(uint8 i = IO_START; i < IO_END; i++)