There are some basic issues with the code:
- variables: value and a are not defined.
- analogRead() does not return a floating point value.
- you redefine f as an int later in the program. This is never a good idea.
- There are missing semicolons and braces ({}) missing.
Guessing at what you're trying to do and supplying the missing braces, I get:
// ?????????? ?????????? ???????:
#include <LiquidCrystal.h>
// ?????????? ?????????? ???????? ?????????:
#include <AccelStepper.h>
// ??????? ????? ???????? ????????? ? ????????? ?????? ???????:
//AccelStepper stepper(AccelStepper::FULL4WIRE, 8, 9, 10, 11);
//AccelStepper stepper2(AccelStepper::FULL4WIRE, 2, 3, 4, 5);
// ?????????? EEPROM - ?????????? ?????? ?????????:
#include <EEPROM.h>
// ?????????? ?????????????? ???????:
#include "math.h"
// ????????? ?????????? ? ???????? ?? ? ???????:
float f = 0;
float SWRpad = 0;
float SWRotr = 0;
float SWR = 0;
// ??????????? ???? ??????????:
LiquidCrystal lcd(10, 11, 12, 13, 14, 15);
void setup ()
{
analogReference(DEFAULT); // ??????????? ??????? ?????????? 5 ?.
lcd.begin(16, 2); // ?????? ??????????? ??????, 2 ?????? ?? 16 ????????.
// ???????????? ???????? ???????? ????????? ? ???????? ? ?????? (RPM).
//stepper.setMaxSpeed(300.0);
//stepper.setAcceleration(100.0);
//stepper.moveTo(1000000);
//stepper2.setMaxSpeed(300.0);
//stepper2.setAcceleration(100.0);
//stepper2.moveTo(1000000);
// ????????? ???????? ?????? ? ??????:
Serial.begin(9600);
}
void loop ()
{
byte value = EEPROM.read(a);
f = analogRead(A0); // ?????? ??????? ???????.
SWRpad = analogRead(A2); // ?????? ?????????? ???????? ?????.
SWRotr = analogRead(A1); // ?????? ?????????? ?????????? ?????.
// ?????? ? ????? ???:
SWR = (SWRpad + SWRotr)/(SWRpad - SWRotr);
// ?????????? ????? ???? ? ???????? SWR - ??????????, ??? ????????? ???????, ???? ????? ???????? ?????, ?? ?????????? ????? ? ????? ????.
// ????? ??????? ??????? ???????? ??????.
lcd.setCursor(0, 0);
lcd.print("SWR");
if (SWR < 1.3) {
lcd.setCursor(4, 0);
lcd.print("<1.3");
}
else {
if (SWR > 3) {
// Read new position
byte f = analogRead(A0);
stepper.moveTo(f);
stepper.setSpeed(100);
stepper.runSpeedToPosition();
}
if (SWR < 1.3) {
lcd.setCursor(4, 0);
lcd.print(SWR);
}
delay(1000);
}
// ???????? ? ??????? ??????:
delay (100);
lcd.clear();
}
which still won't compile because of missing data, but at least it's more readable.