Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: Take a string of recivied on a Serail port and pharseing it. on: April 23, 2014, 09:29:52 pm
Below is some test code you can try with the serial monitor. Sending a cr/lf in the middle of a string is tough using the serial monitor, so I used  * instead of the lf.

Code:
//send string using serial monitor
// test string "message_status,address,address_text,service_center_time_stamp,<CR><LF>*sms_message_body"

String readString;
//int loc;

void setup() {
  Serial.begin(9600);
  Serial.println("parse-test-3"); // so I can keep track of what is loaded
}

void loop() {
  while (Serial.available()) {
    delay(2);  
    if (Serial.available() >0) {
      char c = Serial.read();  //gets one byte from serial buffer
      if (c == '*') { //substitute \n
        while (Serial.available()) {
          delay(2);  
          if (Serial.available() >0) {
            char c = Serial.read();  //gets one byte from serial buffer
            readString += c; //makes the string readString
          }
        }

      }      
    }
  }

  if (readString.length() >0) {
    Serial.print("Message is: ");    
    Serial.println(readString); //see what was received
    readString="";
  }
}





THANK YOU SOOOO MUCH THAT WORKS PERFECTLY!!!! OMG IVE BEEN WORKING ON THIS FOR 12HRS!!!! Thank you so much
2  Using Arduino / Programming Questions / Re: Take a string of recivied on a Serail port and pharseing it. on: April 23, 2014, 09:01:06 pm
thanks. yea ive been at this all day and spelling at this point is mute lol
3  Using Arduino / Programming Questions / Take a string of recivied on a Serail port and pharseing it. on: April 23, 2014, 07:25:57 pm
Hello all,

I really could use a nudge in the right derection.   

I have a string that i need to strip out everything except for a message ( text message) from sim900 shield.

the string comes in like this

message_status,address,address_text,service_center_time_stamp,<CR><LF>sms_message_body <-- im assumeing there is a Null here

I need to strip everything but the sms_message_body and put in in a string like

String textmessage = "hello"

i am completely new to c++ and have no idea how to do this.
4  Using Arduino / Project Guidance / Arduino as a Jtag programer on: February 09, 2011, 10:10:33 pm
Hey Guys and Gals!  I really need some help here. Im new to arduino and programing in general. I have a PDA that acccidently turned off while i was reprograming the boot loader! so needless to say its bricked. it uses the Intel pxa 27- ( i think) processor and i have the pin outs for the Jtag interface. but i cant afford the $200 for the jtag unit! i only paid $30 for the pda lol.

I done some googleing and found 1 forum post of a guy useing an arduino as a jtag programmer but thats all I found. I would be greatly indebted to someone if they could help me out.

Thanks!

you can reply here or hit me up on yahoo messenger my ID there is fatboyscar or email me at will@c2h2.net
5  Forum 2005-2010 (read only) / Interfacing / TLC5940 led animations on: January 20, 2011, 01:34:55 am
I have a 4x4 matrix useing the TLC5940 chip and lib from aclone

problem i have i am trying to play animations but im lost on how to get the animations to play. i have create the frames for the animations but from reading the lib docs it looks like the function plays them in reverse but it looks nothing like it should on the leds.

Im going to post what i have and see if anyone can help me out
Quote
     if (!tlc_onUpdateFinished) {

    delay(100);

        tlc_playAnimation(rayGun, RAY_GUN_FRAMES, 250);
 }


Quote
#define RAY_GUN_FRAMES  20
uint8_t rayGun[NUM_TLCS * 24 * RAY_GUN_FRAMES] PROGMEM = {
 0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,
 0,0,255,0,0,0,255,255,0,0,0,0,0,0,0,0,
 0,255,0,0,0,255,0,0,0,255,255,255,0,0,0,0,
 255,0,0,0,255,0,0,0,255,0,0,0,255,255,255,255,
 0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,
 0,0,255,0,0,0,255,255,0,0,0,0,0,0,0,0,
 0,255,0,0,0,255,0,0,0,255,255,255,0,0,0,0,
 255,0,0,0,255,0,0,0,255,0,0,0,255,255,255,255,
 0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,
 0,0,255,0,0,0,255,255,0,0,0,0,0,0,0,0,
 0,255,0,0,0,255,0,0,0,255,255,255,0,0,0,0,
 255,0,0,0,255,0,0,0,255,0,0,0,255,255,255,255,
 0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,
 0,0,255,0,0,0,255,255,0,0,0,0,0,0,0,0,
 0,255,0,0,0,255,0,0,0,255,255,255,0,0,0,0,
 255,0,0,0,255,0,0,0,255,0,0,0,255,255,255,255,
 0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,
 0,0,255,0,0,0,255,255,0,0,0,0,0,0,0,0,
 0,255,0,0,0,255,0,0,0,255,255,255,0,0,0,0,
 255,0,0,0,255,0,0,0,255,0,0,0,255,255,255,255
};




6  Forum 2005-2010 (read only) / Interfacing / Re: TLC 5940 and vars. on: January 14, 2011, 02:22:41 pm
ah i see, i was just reading that the va_ command set doesnt seem to work well with arduino. any other ideas on how to do this.
7  Forum 2005-2010 (read only) / Interfacing / TLC 5940 and vars. on: January 14, 2011, 01:18:17 pm
Hello everyone, I'm new to the arduino world. I have desided to try to build an led matrix useing the TLC5940 led driver. We are working very small scale to start with but heres my issue with useing the tlc5940 lib.
I want to be able to turn on several leds at a time with having to call them one by one in the code. here is what i have so far but it does not work correctly as in the code it turns on led 0 1 2 5 10 15 when all i wanted was to turn on led 0, 5, 10, 15

this code is partial to the whole code i have which just as a bunch of these statements which dont work lol.

EDIT: we are starting off with 1 tlc and 16 single leds, next step will be 3 tlc  and 16 RGB leds

Quote
#include "Tlc5940.h"

void setup() {
  Tlc.init();
}

void setLED(int level, ... )
{
   va_list leds;
   int ledNumber = -1;

   va_start(leds, level);
   while((ledNumber = va_arg(leds, int)) != -1)
   {
      Tlc.set(ledNumber, level);
   }
   va_end(leds);
}

void loop() {
  setLED(4095, 0, 5, 10, 15);
  Tlc.update();
  delay(550);
}


any and all help is appreciated


Pages: [1]