Error compiling for board Arduino/Genuino Uno.


hi new arduino , trying write code of temperature controlled fridge can adjust pot , temp in fridge changes lowest setting -15 , highest setting 30degrees. the temp drops below input pot im trying make compressor turn on , light show compressor on. new @ , im still not quite sure im doing. error below keeps popping , im not quite sure whats wrong code. im hoping on close path how should have done it, how fix error appreciated.









arduino: 1.8.4 (windows 10), board: "arduino/genuino uno"

c:\users\admin\appdata\local\temp\ccfcxdpc.ltrans0.ltrans.o:(.rodata+0x6): undefined reference `print::write(unsigned char const*, unsigned int)'

c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr5/crtatmega328p.o:(.init9+0x0): undefined reference `main'

collect2.exe: error: ld returned 1 exit status

exit status 1
error compiling board arduino/genuino uno.

this report have more information with
"show verbose output during compilation"
option enabled in file -> preferences.









code: [select]
//
const int temppin=a0;
const int potpin=a1;
int potvalue;
int settemp;
int compressor=13;
int light=12;
void setup() {
 // put setup code here, run once:
serial.begin(9600);
pinmode (temppin,input);
pinmode (potpin,input);
pinmode (compressor,output);
pinmode (light,output);
}

void loop() {
 // put main code here, run repeatedly:
int tempvalue= analogread(temppin);
float voltage=(tempvalue/1024.0)*5.0;
serial.print (",degrees c:");
float temperature=(voltage-0.5)*100;
serial.println(temperature);
potvalue=analogread(potpin);
settemp=map(potvalue,0,1023,-15,30);
serial.print("set temp:");
serial.print(settemp);
if (temperature>settemp){
 digitalwrite(compressor,high);
 digitalwrite(light,high);
}
delay(200);
}]








code: [select]
[code][/code]

it looks there nothing code produce error.  can compile example sketches such blink ?


Arduino Forum > Using Arduino > Programming Questions > Error compiling for board Arduino/Genuino Uno.


arduino

Comments

Popular posts from this blog

Installation database is corrupt

esp8266 (nodemcu 0.9) client.write très lent ???