where I´m stuck is at using pointers to access data in the struct.
int16 pointer;
for (index=0;index<=160;index++) {
eeprom_write(..config..don´t know how to access); //write or read
delay_ms(10); // let write cycle to end
}
Darren Rook
Joined: 06 Sep 2003 Posts: 287 Location: Milwaukee, WI
Posted: Sat May 29, 2004 10:28 am
how about this:
Code:
int8 *pointer;
int8 index;
int8 eeprom_address=0;
pointer=&config;
for (index=0;index<=sizeof(config);index++) {
eeprom_write(eeprom_address++,*pointer);
pointer++;
}
Also, I don't think you need the delay... I think eeprom_write() will wait until the last write cycle ended.
future
Joined: 14 May 2004 Posts: 330
Posted: Sat May 29, 2004 2:34 pm
And how about accessing bits individually? like config.speed.bit0..bit7
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum