Hello,
I'm using Sparkfun ProMicro card. The design purposes are:
- Set PWM output, based on specific command string , sent by PC serial terminal, and received by card serial.
- Send acknowledge message via serial.
Problem:
In some serial monitors, no acknowledge is received by PC although command itself is applied. In other monitors, including Aduino IDE built in monitor, the functionality is complete both ways.
Relevant code quotations:
void setup() {
Serial.begin(115200);
while (!Serial);
}
void loop() {
if (Serial.available() > 0) {
stMsg = Serial.readString();
strpos = stMsg.indexOf(txt);
if(strpos >= 0){
gg = stMsg.substring(strpos + 3);
PWM_val = gg.toInt();
stEcho = stMsg.charAt(strpos +2);
stEcho = stEcho+"="+PWM_val;
Serial.println(stEcho);
analogWrite(PWM_UVA_pin, PWM_val);
}
Thank you for suggestions,
Gershona