How to remove some characters off a char


hey guys , gals :smiley-red:  :smiley-red:

i have yet problem,

i've gotten sim 900 board speak arduino i'm sending commands , receiving them, see updated sketch below:

code: [select]
#include <softwareserial.h>

softwareserial sim900(2, 3);

void setup() {
  serial.begin(9600);
  sim900.begin(4800);
  serial.println("comm's initiated");
 
  sim900power();
  serial.println("sim 900 power cycle complete switch on!");
}

void sim900power()  {
  digitalwrite(8, high);
  delay(5000);
  digitalwrite(8, low);
  delay(10000);
}

void loop() {
 
  sim900.print("at+csq\r");
  delay(5000);
 
  while (sim900.available() > 0)  {
    char che = sim900.read();
    serial.print(che);
   
  }
}


my big problem want variable (che) smaller, see attached serial monitor capture,

as can see on serial monitor prints
at+csq
+csq: 10,0

ok

i want remove characters excluding 10 (the ,0 isnt train smash)

is there here can show me how this?

thanks
cal :d

the examples in serial input basics may give ideas.

you need  think features identify data want extract.
for example first thing after colon , followed comma ?

if is, can use characters start , end markers.

...r



Arduino Forum > Using Arduino > Programming Questions > How to remove some characters off a char


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code