summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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++)