Go Down

Topic: Please help. any suggestion about message library (Read 526 times) previous topic - next topic


Hi, everyone. I'm a beginner

Pls help, can change massage all to lower string?

How can I do it?

Arduino recieve message from GSM Module. And i need to change its all to lower string. Now, I use message library.

#include <Messenger.h>
#include <String.h>
#include <stdio.h>

// Instantiate Messenger object with the message function and the default separator
// (the space character)
Messenger message = Messenger();

// Define messenger function
void messageCompleted() {
 Message = Message.ToLower();
 // This loop will echo each element of the message separately
 while ( message.available() ) {
   if ( message.checkString("on") ) {
   } else if ( message.checkString("of") ) {
   } else if ( message.checkString("off") ) {
   } else if ( message.checkString("ooff") ) {
   } else {
     break; }

void setup() {
 // Initiate Serial Communication

void loop() {
 // The following line is the most effective way of
 // feeding the serial data to Messenger
 while ( Serial.available() ) message.process( Serial.read() );


Above codes won't work.

Thanks advance.


Jan 11, 2010, 01:22 pm Last Edit: Jan 11, 2010, 01:22 pm by GrooveFlotilla Reason: 1
You could OR each character with 0x20, I think, as long as you know it is a letter A-Z.
A->a (0x41 -> 0x61)
Z->z (0x5A -> 0x7a)

Or use "tolower".
Some people are like Slinkies.

Not really good for anything, but they bring a smile to your face when pushed down the stairs.


Hi, Groove.
Thanks for your suggestion.
I will try.

Go Up