Additional Codework on Distance_Sensor
This commit is contained in:
parent
d7ac8f546a
commit
dc8b1cde31
3 changed files with 10 additions and 4 deletions
|
@ -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;
|
||||
|
|
|
@ -51,6 +51,9 @@ public:
|
|||
this->slaveAddr = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
// initialiate the sensor
|
||||
srf10_init();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -44,6 +44,9 @@ Robot::Robot()
|
|||
//Activate interrupt
|
||||
sei();
|
||||
|
||||
// Initialiate TWI
|
||||
Init_TWI();
|
||||
|
||||
//Interface
|
||||
for(uint8 i = IO_START; i < IO_END; i++)
|
||||
{
|
||||
|
|
Reference in a new issue