From dc8b1cde313f3f8a60462187bbeeea4277fd0313 Mon Sep 17 00:00:00 2001 From: meyma Date: Thu, 22 Feb 2007 14:27:02 +0000 Subject: Additional Codework on Distance_Sensor --- source/Concept/Framework/atmega128io.c | 4 ++-- source/Concept/Framework/modules/input/distance_sensor.h | 5 ++++- source/Concept/Framework/robot.c | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'source/Concept/Framework') 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<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< enable counter //Activate interrupt - sei(); + sei(); + + // Initialiate TWI + Init_TWI(); //Interface for(uint8 i = IO_START; i < IO_END; i++) -- cgit v1.2.3