extern void OWINIT();
-
+extern void EXTERN_SLEEP();
uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x77, 0x6B};/**/
-uint8_t config_info[16]={0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+uint8_t config_info[16]={0x03,0x04, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
#if (owid>128)
#error "Variable not correct"
extern uint8_t alarmflag;
-
+uint8_t max_adr=0;
typedef union {
volatile uint8_t bytes[8];
MCUSR=0;
USI_TWI_Master_Initialise();
-
+ if (checkMAX44009(0)) max_adr=0; else max_adr=1 ;
gcontrol=1;
+ //DDRB|=(1<<PINB1);
sei();
while(1) {
if (gcontrol) {
- volatile double l=MAX44009getlux();
+ //PORTB|=(1<<PINB1); //Dauer 2.3ms
+ volatile double l=MAX44009getlux(max_adr);
if (l<0.030) l=0.030; //Darf nicht 0 sein. minimum -35°C Sensor minimum 0.045
//double l=1000;
l=log(l)*10*16;
pack.temp=w;
//pack.temp++;
alarmflag=af;
- sei();
- gcontrol=0;
+ sei();
+ EXTERN_SLEEP();
+ //PORTB&=~(1<<PINB1);
}