error: ?map? was not declared in this scope

Hi everyone, hope you can help.

I'm trying to use the map function in the following code:

int val1;

void setup() {
  Serial.begin(9600); 
}

void loop() {
  val1 = analogRead(1);
  val1 = map(val1, 0, 1023, 0, 255);
  Serial.println(val1);
  delay(200);
}

But when compiling I get this error:

In function 'void loop()':
error: 'map' was not declared in this scope

I'm stumped.

Thanks in advance, Easty.

What version of the Arduino software are you using? map() was added recently.

I got the same error.
I have the version 11 of the software, so it should be there.

It's not like it's a big deal, but it's weird.

Curious.

In your Arduino/hardware/cores/arduino/WProgram.h, do you have the following:

#ifdef __cplusplus
#include "HardwareSerial.h"

unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);

// WMath prototypes
long random(long);
long random(long, long);
void randomSeed(unsigned int);
long map(long, long, long, long, long);
#endif

If so, this should have provided the prototype for map() that you seem to be missing. Do you get the same error when you call the random() function?

Mikal

What operating system are you guys on?

Problem solved :-[.

What I thought to be 0011 was in fact 0010. It appears I somehow didn't have the latest version. My apologies.