我这里有一些代码,说我有一个没有前一个 if 的 else,问题是有一个 if。还有我如何在这里使用模数,说无效的二元运算符???
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
Serial.begin(9600);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
}
void loop() {
delay(500);
int sensorval = analogRead(A0);
float outval = (sensorval/1024.0) * 5.0;
float cel =(outval - .5) * 100;
float far = (cel*1.8000000)+32;
lcd.setCursor(0,0);
lcd.print("Farien ");
lcd.print(far,6);
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
double secs = (millis()/1000);
if(secs <= 60.0);
{
lcd.print(millis()/1000);
}
else
{
double hrs = (millis()/1000) / 3600.0;
double mins = hrs / 60.0;
double secs = mins % 60;
}
}
这看起来很简单,但我是一个菜鸟,需要一些重要的帮助