Go Down

Topic: How do I make the SimpleMessageSystem work? (Read 617 times) previous topic - next topic

NeilM

Jul 14, 2008, 01:55 pm Last Edit: Jul 14, 2008, 07:28 pm by NeilM Reason: 1
I'm trying to send information from the computer to the LED's hooked up to the PWM pins on my arduino but I can't seem to figure out the Serial interface for it.

I just tried to install SimpleMessageSystem, but I can't get the messageBuild() command to return anything other then 0.  Does anyone know what I might be doing wrong?

I extracted SimpleMessageSystem.zip to C:\progra~1\arduino-0011\hardware\libraries
Loaded the arduino software and in my program selected Sketch->Import Library->SimpleMessageSystem
It puts an include at the top #include <SimpleMessageSystem.h>
In my loop function I make a call to:
Code: [Select]
void checkForData()
{
 Serial.println("Checking");
 if (messageBuild() > 0)
 {
   Serial.println("Message Built");
   switch (messageGetChar())
   {
      case 'w':
        Serial.println("WritePin");
        writePin();
   }
 }
}


But when I run it and send "w a 3 255 ", all I see is "Checking" in the Serial input window.

NeilM

I figured it out.  It was a couple different issues (Just in case someone runs into this issue in the future).
First of all I a carrage return in hyper terminal or other windows software didn't seem to work.
It wasn't until I added:
case 42: // Asterix *
to SimpleMessageSystem.cpp that I saw data showing up on the Arduino.  My best guess is it was expecting a mac carrage return.

My other problem was it doesn't make a new .o file for the include every time, so my changes weren't being recompiled.  All I needed to do was delete it.

Once I fixed those two issues, SMS started working.

bHogan

Just to make it more clear what you did . . .
You added case 42 just before case 13.
Then you added an asterisk at the end of each command - i.e. "w d 13 1* <CR>"

I had the same problem as you using the IDE to send messages.
However using Tera Term Pro (a great little free terminal) I had no problem.
(Didn't need the asterisk)

Thanks for posting back your findings.  :)
"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview