arduino - Function-definition is not allowed here before '{' token -
i have been working simple program trying fix error way long. working arduino , want make easy temperature monitor turn switches on , off. keep getting error "function-definition not allowed here before '{' token." if knows more , can me out, great!
float temp; void setup(){ pinmode(13, output); pinmode(8, output); pinmode(9, output); pinmode(10, output); pinmode(11, output); pinmode(7, input); pinmode(0, input); serial.begin(9600); } void highheat(){ temp = analogread(0); temp = (5.0*temp*100.0/1024.0); if (temp > 79) { digitalwrite(8, low); digitalwrite(9, low); digitalwrite(10, low); digitalwrite(11, low); digitalwrite(13, low); } if (temp < 78) { digitalwrite(8, high); digitalwrite(9, high); digitalwrite(10, high); digitalwrite(11, high); digitalwrite(13, high); } delay(10000); } void lowheat(){ temp = analogread(0); temp = (5.0*temp*100.0/1024.0); if (temp > 26) { digitalwrite(8, low); digitalwrite(9, low); digitalwrite(10, low); digitalwrite(11, low); digitalwrite(13, low); } if (temp < 25) { digitalwrite(8, high); digitalwrite(9, high); digitalwrite(10, high); digitalwrite(11, high); digitalwrite(13, high); } delay(10000); } void loop(){ if (6 == high) { delay(2000); if (6 == high) { digitalwrite(13, high); delay(500); digitalwrite(13, low); delay(500); digitalwrite(13, high); delay(500); digitalwrite(13, low); delay(500); digitalwrite(13, high); delay(500); digitalwrite(13, low); delay(500); digitalwrite(13, high); delay(500); digitalwrite(13, low); void loop(){ lowheat(); } } if (6 == low) { digitalwrite(13, high); delay(500); digitalwrite(13, low); delay(500); digitalwrite(13, high); delay(500); digitalwrite(13, low); void loop(){ highheat(); } } } }
p.s. i've done searching , found many posts same title, never seem relevant problem, thought ask little help.
you have:
digitalwrite(13, low); void loop(){ lowheat(); }
the compiler complaining void loop()
there. can't define function in middle of one.
Comments
Post a Comment