Pages: [1]   Go Down
Author Topic: How do I make the SimpleMessageSystem work?  (Read 606 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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.
« Last Edit: July 14, 2008, 12:28:43 pm by NeilM » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Denver
Offline Offline
God Member
*****
Karma: 20
Posts: 779
Inactive - PM
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  smiley
Logged

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

Pages: [1]   Go Up
Jump to: