sparkfun / SparkFun_MLX90640_Arduino_Example

Controlling and reading from the MLX90640 IR array thermal imaging sensor
https://www.sparkfun.com/
Other
122 stars 35 forks source link

'Serial' was not declared in this scope #18

Closed h-Naima-s closed 4 years ago

h-Naima-s commented 4 years ago

Getting the following error message when uploading this code on arduino:

sketch\MLX90640_I2C_Driver.cpp: In function 'int MLX90640_I2CRead(uint8_t, unsigned int, unsigned int, uint16_t*)':

MLX90640_I2C_Driver.cpp:48:7: error: 'Serial' was not declared in this scope

   Serial.println("No ack read");

   ^

sketch\MLX90640_I2C_Driver.cpp: In function 'int MLX90640_I2CWrite(uint8_t, unsigned int, uint16_t)':

MLX90640_I2C_Driver.cpp:95:5: error: 'Serial' was not declared in this scope

 Serial.println("Error: Sensor did not ack");

 ^

exit status 1 'Serial' was not declared in this scope

qTp commented 4 years ago

Has a solution been found for this problem? I get the same error message, with an Adruino Leonardo board.

h-Naima-s commented 4 years ago

Yes! so you need to run the code as it is on Processing app. It will show you 2 ports with error message, and out of those 2 will show you one as available. you need to then go to myPort on line 59 and change the port number to one that is showing available. This was what going wrong with me.

qTp commented 4 years ago

thanks for the fast answer. i've found another soultion: In the MLX90640_I2C_Driver.h, i included the "Arduino.h" header file.

santaimpersonator commented 4 years ago

Seems resolved and Arduino header previously mentioned in issue #2.

Closing issue.