WinAVR +Mega2560 - ATOL, ATOF does not work

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using the 2007 release of WinAVR and compiling for a Mega2560. Now in the past, there has been some compiler issues relating to the 2560 that were fixed. However, I am finding the ATOL and ATOF function is not working at all. The ATOI is fine though.

Anybody?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok .. does not work on a mega8 as well.

I can do this ...

char disp[10];
unsigned long t;
char number[7] = "123456";

// this works ...
t = 123456
sprintf(disp, "%ld", t)

// this does not work
t = atol(number);
sprintf(disp, "%ld", t)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok ..ok .. me kicks myself.

I missed the warning implicit declaration of atol.

Added
#include

works now.