go_away

Author Topic: webbotlib a2dinit crashing the code?  (Read 611 times)

0 Members and 1 Guest are viewing this topic.

Offline mstachoTopic starter

  • Supreme Robot
  • *****
  • Posts: 364
  • Helpful? 10
webbotlib a2dinit crashing the code?
« 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
Current project: tactile sensing systems for multifingered robot hands

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 109
Re: webbotlib a2dinit crashing the code?
« Reply #1 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.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline mstachoTopic starter

  • Supreme Robot
  • *****
  • Posts: 364
  • Helpful? 10
Re: webbotlib a2dinit crashing the code?
« Reply #2 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
Current project: tactile sensing systems for multifingered robot hands

 


Get Your Ad Here

data_list