Society of Robots - Robot Forum

Software => Software => Topic started by: mstacho on July 31, 2012, 05:16:09 PM

Title: webbotlib a2dinit crashing the code?
Post by: mstacho on July 31, 2012, 05:16:09 PM
This is odd.  I've traced the problem to a2dInit() (I've found out that this is the issue by actually using it explicitly, it just stops the code from working :-P)

All the code SHOULD do is

int forceRead = a2dConvert8bit(0); //yeah, I tried with NUMBER TO CHANNEL macros I just forgot what they actually are :-P it's ADC0 anyway

But this fails.  In fact, for some reason, the code doesn't even run, since I have a debug rprintf at the very top of the code that doesn't show up.

Commenting it out makes the code work again (all the print statements give output).  Explicitly calling a2dInit() causes the failure.

It's an Axon, using AVRStudio 5.1.  I've tried using AVRStudio 4 but it's being stupid and for some reason just won't connect to my device, hence 5.1.

Any thoughts, anyone?  This is almost identical code to what has run before, so all of my includes are there...

MIKE
Title: Re: webbotlib a2dinit crashing the code?
Post by: Webbot on August 01, 2012, 01:50:38 PM
What version of WebbotLib are you using? Version 2 doesn't have 'a2dInit' so I guess its version 1.

You never need to call a2dInit yourself - its called auto-magically on power up if your are using any a2d devices.
Title: Re: webbotlib a2dinit crashing the code?
Post by: mstacho on August 01, 2012, 01:54:49 PM
Yeah, V1.  I didn't call a2dInit() initially, I just did it to test if that was where the issue was.  For some reason, it was.  Can't explain it :-P Oh well, I've given up on my Axon for the time being and moved into an ARM Cortex board.  I might play with the Axon later to see what the issue was.

THanks,

MIKE