if (message = 's')
{
{
if (rpmcount >= 2)
{
//Update RPM every 20 counts, increase this for better RPM resolution,
//decrease for faster update
rpm = 30*1000/(millis() - timeold)*rpmcount;
timeold = millis();
rpmcount = 0;
Serial.println(rpm,DEC);
}
}
}
Maybe you need some more curly braces here...