Show Posts
Pages: [1]
1  International / Proyectos / Job offer in germany on: May 25, 2012, 01:39:05 am
Hello folks,

sorry for writing english - my spanish is equal to zero.
I´m looking for someone to strongen our development department.
We are producing wireless comunication systems - especially for guided tours.
Feel free to check our homepage : www.meder-commtech.com

To enter new application there is the strong need to combine our traditional products with microcontrollers, displays etc.

So my wish list is:

electronic skills:
     soldering (also SMD)
     develop schemes
     layout PCB´s

mechanical skills:
    milling
    turning
    ... building nice prototypes

soft skills
    english or german
    Windows office
    Eagle PCB software
    Micorcontroller programming

Location:
This job may require to move your home.
We are located in one of the most beautifull areas in germany - the lake constance.
The 50 km long lake is directly in fron of the swiss alps.
Zürich (swizerland) is in 50km distance.

If this offer make you courious please get in contact with me:
dpapa@meder-funk.de

Looking forward to hear from you :-)
Dominik
2  International / Deutsch / Re: Formatierung von Variablen on: May 16, 2012, 09:19:36 am
Bitte nicht zu laut lachen...
Ich kopier mir was zusammen, und schau ob es geht.
Aber so langsam verstehe ich schon ein bischen, was da passiert (oder auch nicht).

Code:
// A simple sketch to read GPS data and parse the $GPRMC string
// see http://www.ladyada.net/make/gpsshield for more info
 
#include <SoftwareSerial.h>

SoftwareSerial mySerial =  SoftwareSerial(2, 3);

#define GPSRATE 9600

// GPS parser for 406a
#define BUFFSIZ 90 // plenty big
#define USERID 123456789
#define STATUS 0
char buffer[BUFFSIZ];
char *parseptr;
char buffidx;
int  hour, minute, second, year, month, date;  //char weil führende Nullen erhalten bleiben müssen
uint32_t tmp, tmp2, longitude, latitude,latitude2,longitude2;
uint8_t groundspeed, groundspeed2, trackangle, trackangle2,magdev;
int checksum;
char latdir, longdir, magdir;
char status;

 
void setup()
{
 
  Serial.begin(38400);
  mySerial.begin(GPSRATE);
 
  // prints title with ending line break
  Serial.println("GPS parser");
}
  uint32_t parsedecimal(char *str) {
  uint32_t d = 0;
 
  while (str[0] != 0) {
   if ((str[0] > '9') || (str[0] < '0'))
     return d;
   d *= 10;
   d += str[0] - '0';
   str++;
  }
  return d;
}
 
 
void loop()//###################
{
 
 
  //Serial.print("\n\rread: ");
  readline();
 
   // check if $GPRMC (global positioning fixed data)
  if (strncmp(buffer, "$GPRMC",6) == 0) {
    Serial.println(buffer); // das ist der original Satz aus dem GPS
   
   
    // hhmmss time data
    parseptr = buffer+7;
    tmp2 = parsedecimal(parseptr);

    //Serial.print(tmp2/1);
    //Serial.println(".000");
    hour = tmp2 / 10000;
    minute = (tmp2 / 100) % 100;
    second = tmp2 % 100;
    //Serial.println (second);


    parseptr = strchr(parseptr, ',') + 1;
    status = parseptr[0];
    //Serial.println(status);
 
    // grab latitude & long data
    // latitude
    parseptr = strchr(parseptr, ',') + 1;
    latitude = parsedecimal(parseptr);
    if (longitude != 0) {
      latitude *= 10000;
      parseptr = strchr(parseptr, '.')+1;
      latitude += parsedecimal(parseptr);

    }
    //Serial.println(latitude);
   
    // read latitude N/S data
    parseptr = strchr(parseptr, ',') + 1;
    if (parseptr[0] != ',') {
      latdir = parseptr[0];
    }
    //Serial.println(latdir);
   
    // longitude
    parseptr = strchr(parseptr, ',')+1;
    longitude = parsedecimal(parseptr);
    if (longitude != 0) {
      longitude *= 10000;
      parseptr = strchr(parseptr, '.')+1;
      longitude += parsedecimal(parseptr);
    }

    //Serial.println(longitude);

   
    // read longitude E/W data
    parseptr = strchr(parseptr, ',')+1;
    if (parseptr[0] != ',') {
      longdir = parseptr[0];
    }
    //Serial.println(longdir);
 
    // groundspeed
    parseptr = strchr(parseptr, ',')+1;
    groundspeed = parsedecimal(parseptr);
    parseptr = strchr(parseptr, '.')+1;
    groundspeed2 = parsedecimal(parseptr);
    //Serial.println(groundspeed);
 
    // track angle ####################### geht nicht
    parseptr = strchr(parseptr, ',')+1;
    trackangle = parsedecimal(parseptr);
    parseptr = strchr(parseptr, '.')+1;
    trackangle2 = parsedecimal(parseptr);
    //Serial.println(trackangle);
 
    // date
    parseptr = strchr(parseptr, ',')+1;
    tmp = parsedecimal(parseptr);
    date = tmp / 10000;
    month = (tmp / 100) % 100;
    year = tmp % 100;
    //Serial.print(date);
    //Serial.print(month);
    //Serial.println(year);
   
    // Magnetische Abweichung
    parseptr = strchr(parseptr, ',')+1;
    magdev = parsedecimal(parseptr);
    //Serial.println(magdev);
   
    // magnetische Richtung
    parseptr = strchr(parseptr, ',')+1;
    magdir = parsedecimal(parseptr);
    //Serial.println(magdir);
   
   
    // Checksum
    parseptr = strchr(parseptr, ',')+1;
    checksum = parsedecimal(parseptr);
    //Serial.println(checksum);
       
 
 QVPOS_Satz(); //Modulaufruf für QVPOS Datensatz


  }
}
 

void readline(void) {//#######################################
  char c;
 
  buffidx = 0; // start at begninning
  while (1) {
      c=mySerial.read();
      if (c == -1)
        continue;
      //Serial.print(c);
      if (c == '\n')
        continue;
      if ((buffidx == BUFFSIZ-1) || (c == '\r')) {
        buffer[buffidx] = 0;
        return;
      }
      buffer[buffidx++]= c;
  }
}


void QVPOS_Satz(){//###########################################
 
   Serial.print("$QVPOS,");
   Serial.print(USERID);
   Serial.print(",");
   Serial.print(STATUS);
   Serial.print(",");
   if (date<10){Serial.print("0");}//erzwingt führende Null
   Serial.print(date, DEC);
   if (month<10){Serial.print("0");}//erzwingt führende Null
   Serial.print(month, DEC);
   if (year<10){Serial.print("0");}//erzwingt führende Null
   Serial.print(year, DEC);
   Serial.print(",");
   if (hour<10){Serial.print("0");}//erzwingt führende Null
   Serial.print(hour, DEC);
   if (minute<10){Serial.print("0");}//erzwingt führende Null
   Serial.print(minute, DEC);
   if (second<10){Serial.print("0");}//erzwingt führende Null
   Serial.print(second, DEC);
   Serial.print(",");
   if (latdir == 'S')
       Serial.print('-');
   Serial.print(latitude); //Punkt auf sechste Stelle von Rechts / alles hinterm Punkt in DEC
   Serial.print(",");
   if (longdir == 'W')
       Serial.print('-');
   Serial.print(longitude); //Punkt auf sechste Stelle von Rechts / alles hinterm Punkt in DEC
   Serial.print(",");
   if (groundspeed2<10);{Serial.print("0");} //erzwingt führende Null
   Serial.print (groundspeed2);
   Serial.print(".");
   if (groundspeed2<10)
   Serial.print (groundspeed2);
   Serial.print(",");             
   Serial.print(trackangle);      //Fake Richtung
   Serial.print(",");             
   Serial.print("0.00");          //Fake Höhe
   Serial.println(Checksum,HEX);          //geht nicht
 }
3  International / Deutsch / Formatierung von Variablen on: May 16, 2012, 08:34:18 am
Hallo,

bitte verzeiht mir, wenn mir die richtigen Wort fehlen - ich hab vor vier Wochen mit all dem hier angefangen...

Ich lese eine GPS Antenne aus und separiere die Worte aus dem GPRMC Satz.
Das passiert auf dem Sketch "Arduino GPS NMEA parser" von ICanBuild.it.

Jetzt will ich mit Länge und Breite weiterarbeiten.
Im GPRMC Satz sind diese in [Grad Minuten PUNKT Sekunden Hunderstel] vorhanden.
NMEA parser macht daraus schonmal [Grad Minuten Sekunden Hunderstel], deklariert als uint32_t => "latitude".
Ich brauche jetzt [Grad PUNKT dezimaler Rest]

Ich habe versucht ein Array mit "latitude" zu laden, bekomme aber "Type assignment" Fehler.

Hat mir jemand einen Tip, in welche Richtung ich vorgehen soll?


viele Grüße
Dominik
Pages: [1]