我正在新的raspberry pi 4上对arduino uno进行编程。我已经安装了arduino IDE v1.8.9,并且在编译代码时遇到问题。
我遇到错误。
avr-g ++:错误:device-specs / specs-atmega328p:没有此类文件或目录
请帮助。
我正在运行Rasbian Os
/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the Serial Monitor.
Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu).
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/AnalogReadSerial
*/
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// print out the value you read:
Serial.println(sensorValue);
delay(1); // delay in between reads for stability
}
答案 0 :(得分:0)
这是arduino-builder缺少位置avr的-tools选项。
之类的设置-工具/home/owner/arduino-1.8.10/hardware/tools/avr
需要才能找到规格文件。将您的compile输出设置为verbose,以查看发出的compile命令,并验证是否存在上述行。