Hello all, I am using platformio instead of the Arduino IDE for this simple project, however, I have come across an error I cannot get past. The error code follows:
In function `main':
<artificial>:(.text.startup+0xf6): undefined reference to `analogRead'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\uno\firmware.elf] Error 1
I have tried all I could think of but I have no idea what to do. My code and configuration files follow:
[env:uno]
platform = atmelavr
board = uno
framework = arduino
lib_deps = arduino-libraries/LiquidCrystal@^1.0.7
Code:
#include <Arduino.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
float temp;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
lcd.clear();
lcd.begin(16, 2);
}
void loop() {
temp = analogRead(A1);
temp = temp * 0.48828125;
lcd.print("Temperature: ");
lcd.print(temp);
delay(1000);
}
If anyone can provide me with any advice it will be greatly appreciated. Thanks!