HIi,
I am stuck in a particular line. dont know where i am wrong ![]()
command stringOne.lastIndexOf is not getting reorganized on compiler.
I am not sure why lastIndecOf is not showing up in orange in this line if (stringOne.lastIndexOf'Sr' > 0)
i have tried latest compiler, please let me know what else i can do.
#include <Stepper.h>
#include "Arduino.h"
#include "string.h"
// change this to the number of steps on your motor
#define STEPS stp
String stringOne ="";
int stp,hz,step1,step2,step3,val,spd;
int hh = 10;
int mm = 10;
int ss = 0;
int deg = 11;
int mint = 11;
int sec = 11;
int HH=0;
int SS1=0;
int SS2= 0;
int SS3 = 0;
int MM=0;
//long deg = 11;
//long mint = 11;
//long sec = 11;
Stepper stepper(STEPS, 8, 9, 10, 11);
int previous = 0;
void setup()
{
stepper.setSpeed(spd);
Serial.begin(9600);
}
void loop()
{
if (Serial.available())
{
while (Serial.available()>0){
char a=Serial.read();
stringOne = String(a) + stringOne;
delay(10);
}
}
{
if (stringOne =="#:GR#")
{
hh = HH + hh;
mm = MM + mm;
ss = SS1 + ss;
Serial.print (hh);
Serial.print (':');
Serial.print (mm);
Serial.print (':');
Serial.print (ss);
Serial.print ('#');
stringOne ="";
}
if (stringOne =="#:GD#"){
Serial.print ('+');
Serial.print (deg);
Serial.print ('*');
Serial.print (mint);
//Serial.print (':');
//Serial.print (sec);
Serial.write ('#');
//Serial.flush();
stringOne ="";
}
}
if (stringOne.lastIndexOf'Sr' > 0)
{
HH *= 3600;
MM *= 60;
SS2 = SS;
SS1 += SS2;
val = HH+MM+SS1 ;
stepper.step(val - previous);
stp = val/2.3;
stringOne ="";
}
if (stringOne == "#:STTT.T#")
{
Serial.print("0.005");
}
if (stringOne =="#:T+")
{
hz += .1;
spd = hz*60;
}
if (stringOne =="#:T-")
{
hz -= .1;
spd = hz*60;
}
}
error:
hnt3.ino: In function 'void loop()':
hnt3:82: error: expected `)' before '\x5372'
hnt3:82: error: could not convert 'stringOne.String::lastIndexOf' to 'bool'
thank you,
Madan