Society of Robots - Robot Forum

Software => Software => Topic started by: teoxan on May 31, 2010, 12:39:08 AM

Title: errors in TPA81 initialization code in Webbtolib
Post by: teoxan on May 31, 2010, 12:39:08 AM

Hi,

I got two errors when initializing the TPA81 in the new Webbotlib.

"../Servos.c:31: error: extra brace group at end of initializer

../Servos.c:31: error: (near initialization for 'tpa.temperature')


below is the part of code I got these errors.

Code: [Select]
#include "C:\My_Robot\WebbotLib\Sensors\Temperature\Devantech\TPA81.h"
Devantech_TPA81 tpa=MAKE_Devantech_TPA81();
Any help would be much appreciated.

Thanks

Title: Re: errors in TPA81 initialization code in Webbtolib
Post by: Webbot on May 31, 2010, 06:19:07 PM
Thanks for the 'heads up'.
To fix your problem: then write the code in the same way as Project Designer does ie specifying the default I2C address:
Code: [Select]
Devantech_TPA81 temperature = MAKE_Devantech_TPA81_At(0xD0);
And the problem should go away.
Title: Re: errors in TPA81 initialization code in Webbtolib
Post by: teoxan on June 01, 2010, 01:01:58 PM


ok,

I'll try it and let you know.

Thanks!