Show Posts
Pages: 1 2 3 [4] 5 6 ... 18
46  Using Arduino / Sensors / Re: HYT 221 from Hygrosens Instruments on: March 21, 2012, 01:02:35 am
I saw this code but it is not working, it is printing always the same values messured at the first time.
So the Code from above does work better.

Andy
47  Using Arduino / Sensors / Re: HYT 221 from Hygrosens Instruments on: March 20, 2012, 05:50:39 am
Hy

zhx for the example. However why do we need the delay of 100ms since when
I do remove this the sensor does still work???
I know it is written in the manual but I see no difference.

Thx
Andy
48  Using Arduino / Project Guidance / Re: Data over video stream on: March 03, 2012, 04:37:15 pm
Quote
Didn't know that this is working this way
Sorry, I assumed you were talking about analogue composite PAL/NTSC/SECAM style video.

If you are, get used to something like an LM1881

Yes it would be a PAL signal and yes I just read about the LM1881 hmm lets see how I can deal with that...
49  Using Arduino / Project Guidance / Re: Data over video stream on: March 03, 2012, 04:30:50 pm
Like teletext, you send the data in BLANKING.
Didn't know that this is working this way, ok so this would be a solution.
Now I do need the components...
50  Using Arduino / Project Guidance / Re: Data over video stream on: March 03, 2012, 04:23:26 pm
Very low bit-rate data in blanking?

Hmm wouldn't this disturb the video signal itself. You should still get a clean Video
without interference....
51  Using Arduino / Project Guidance / Data over video stream on: March 03, 2012, 04:17:41 pm
Hy

Is it possible to send data over a video Signal?
So on one side of the Arduino the raw video signal is coming in. The
Arduino does attach some information.
And than a second Arduino could detect this data in the Video signal
and process it...
How can I achieve this?

Thx
Andy
52  Using Arduino / Programming Questions / Re: math and cosinus on: January 06, 2012, 08:52:21 am
ahhhhh sorry for that but how could I miss that!!!

Thx a lot you saved me a lot of time smiley
53  Using Arduino / Programming Questions / math and cosinus on: January 06, 2012, 08:42:23 am
Hy

Hmm I like to calculate the cos-1() but when I use acos the result is wrong.
So: cos-1(500/1000) => 60° the Arduino does calculate 90° why?

This is the code:
Code:
float alpha = acos(500/1000);
int grad = alpha*57.2957795131; //is the same as (180/pi)
Serial.println(grad);

What am I doing wrong?

THx
Andy
54  Using Arduino / Displays / 2.8" TFT Touch Shield on: July 13, 2011, 09:00:14 am
Hy

I just got the new 2.8 TFT Touch Shield from SeeedStudio:
http://www.seeedstudio.com/depot/28-tft-touch-shield-p-864.html?cPath=132_134
First I used the sketch below which worked great. Then I added a few Rectangles and
more circles but suddenly the Screen stayed white even after disconnecting from the Arduino
and reattaching.

I then just tried the example sketch but the Display stays white....
I tried several things but still it won't change anything... Is the Display already dead?



// Draw Circles - Demonstrate drawCircle and fillCircle APIs

#include <stdint.h>
#include <TouchScreen.h>
#include <TFT.h>
#define SEEEDUINO

#define YP A2   // must be an analog pin, use "An" notation!
#define XM A1   // must be an analog pin, use "An" notation!
#define YM 14   // can be a digital pin, this is A0
#define XP 17   // can be a digital pin, this is A3


void setup()
{
  Serial.begin(19200);

  Tft.init();  //init TFT



  Tft.drawCircle(100, 100, 30,YELLOW);
  Tft.drawCircle(100, 200, 40,CYAN);
  Tft.fillCircle(200, 100, 30,RED);
  Tft.fillCircle(200, 200, 30,BLUE);
}

void loop()
{

}
55  Using Arduino / Programming Questions / Re: How can an Arduino crash? on: June 17, 2011, 01:37:55 am
Thx for the explenation. Thats why I use:

Code:
counter++;
        if (counter == (BUFFSIZ-1)){
          counter = 0;
          break;
        }

so if counter for the buffer is  equal to the BUFFSIZ, the counter value gets back to 0 and the buffer won't get over its edge. The Message in the buffer will be worthless but in general i do send just SMS with 10 characters to the Arduino so every other SMS it gets will be rejected....

But can someone tell me how to parse the Information from a GSM Module. Not every sentence will start with a $ sign like the GPS they are different. Sometimes they start with "+" or "/n" or even "*"....
56  Using Arduino / Programming Questions / Re: How can an Arduino crash? on: June 16, 2011, 04:13:30 pm
Hmm but I do read first the data into a buffer until a new line "\r" does show up. This gets then parsed by the code.

There is a mistake with the  while(x < 20 && millis() <= (milliSMS + 200)) this routine is just to clear the buffer of
sms_number to store the new number. Actually I don't need this one because it gets overwritten by the new number...

by the way the parsing works I can decode those message with this code...
57  Using Arduino / Programming Questions / Re: How can an Arduino crash? on: June 16, 2011, 09:55:06 am
The code is just too big but here is a part of my GSM data parsing.


Code:
void readGSM(int val){

  while(Serial1.available() > 0){
    if(unlock_sms==0){
      ReadSerial[0]=Serial1.read();
      if(debug > 1)
        Serial.print( ReadSerial[0]);

      if(ReadSerial[0]=='\n' || ReadSerial[0]=='*' || ReadSerial[0] == '+'){
        unlock_sms=1;
      }
    }
    else{
      ReadSerial[counter]=Serial1.read();
      if(debug > 1)
        Serial.print(ReadSerial[counter]);
      if(ReadSerial[counter] == '\r'){
        unlock_sms=0;

        if (strncmp(ReadSerial, "+CMTI:",6) == 0){
          char *parseptr_read = ReadSerial+7;
          parseptr_read = strchr(parseptr_read, ',') + 1;
          char *token = strtok_r(parseptr_read, ",", &brkb);
          int value = atol(token);

          send_serial("AT+CMGF=1");
          delay(50);
          Serial1.print("AT+CMGR=");
          Serial1.println(value);
        }


        if (strncmp(ReadSerial, "CMGR:",5) == 0){
          char *parseptr_read = ReadSerial+6;
          parseptr_read = strchr(parseptr_read, ',') + 2;
          //sms_number = strtok_r(parseptr_read, "\"", &brkb);
          //Serial.println(sms_number);

          int cou=0;
          int cou1 = 0;

          int x = 0;
          unsigned long milliSMS = millis();
          while(x < 20 && millis() <= (milliSMS + 200)){
            sms_number[x] = 0;
            x++;
          }

          milliSMS = millis();

          while(parseptr_read[cou1] != '"' && millis() <= (milliSMS + 1000)){
            if(parseptr_read[cou1] == '+'){
              sms_number[cou] = '0';
              cou++;
              sms_number[cou] = '0';
            }
            else{
              sms_number[cou] = parseptr_read[cou1];
            }
            cou++;
            cou1++;
          }
          if(debug > 0){
            Serial.println();
            Serial.print("-> SMS from: ");
            Serial.println(sms_number);
          }
        }

        if (strncmp(ReadSerial, "NORMAL POWER DOWN",17) == 0) {
          Serial.println("-> GSM OFF");
        }

        if (strncmp(ReadSerial, "+CFUN: 1",8) == 0) {
        }

        if (strncmp(ReadSerial, "Call Ready",10) == 0) {
        }

        if (strncmp(ReadSerial, "0",1) == 0){
          if(debug > 0)
            Serial.println("-> OK");
          if(val == 1)
            sms_send_best = 1;
        }
        if (strncmp(ReadSerial, "+CRING:",7) == 0 && calling < 1){
          if(debug > 0)
            Serial.println("-> ding dong");
        }

        if (strncmp(ReadSerial, "+CMS ERROR: 515",15) == 0){
          if(debug > 0)
            Serial.println("-> PS Busy....");
        }


        if (strncmp(ReadSerial, "+CLIP:",6) == 0){
          char *parseptr_read = ReadSerial+8;
          int cou=0;
          unsigned long milliSMS = millis();
          while(parseptr_read[cou] != '"' && millis() <= (milliSMS + 200)){
            calling_number[cou] = parseptr_read[cou];
            cou++;
          }
          if (calling == n_of_calling){
            send_serial("ATH");
            calling = 0;
            sms_senden = 2;
          }
          else{
            calling++;
          }
        }

        if (strncmp(ReadSerial, "3",1) == 0){
          Serial.println("-> NO CARRIER");
          calling = 0;
        }
        if (strncmp(ReadSerial, "4",1) == 0){
          Serial.println("-> ERROR");
        }
        if (strncmp(ReadSerial, "6",1) == 0){
          Serial.println("-> NO DIALTONE");
        }
        if (strncmp(ReadSerial, "7",1) == 0){
          Serial.println("-> BUSY");
        }
        if (strncmp(ReadSerial, "8",1) == 0){
          Serial.println("-> CONNECT OK / NO ANSWER");
        }

        for(int a=0; a<=counter; a++){
          ReadSerial[a]=0;
        }
        counter=0;
      }
      else{
        counter++;
        if (counter == (BUFFSIZ-1)){
          counter = 0;
          break;
        }
      }
    }
  }
}

maybe there is a better way...
The "ReadSerial" variable is a 120 Char so it might be too big...

58  Using Arduino / Programming Questions / Re: How can an Arduino crash? on: June 14, 2011, 05:24:04 pm
for the GPS decoding I use the "tinygps" library.
Mine isn't running continuously just for about ~10hours and gets
afterwards switched off...
59  Using Arduino / Programming Questions / Re: How can an Arduino crash? on: June 14, 2011, 04:15:17 pm
I tested the device several or better many many times and it old worked very well until
today where it got stuck...
The while loop is the only thing I do know directly so that was also the reason why asked
you here what other problems could occur...


60  Using Arduino / Programming Questions / Re: How can an Arduino crash? on: June 14, 2011, 03:54:35 pm
I know, but I just asked if there is a possibility that the program stops without a loop that is running mad.

Could it be an Available Memory problem (to large char's)? but my tests showed it does just reset itself...

Pages: 1 2 3 [4] 5 6 ... 18