User Tools

Site Tools


weasel_code

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
weasel_code [2011/07/17 15:14]
chrism created
weasel_code [2011/09/20 11:27] (current)
chrism [circuit diagram]
Line 6: Line 6:
 This is the latest code. It uses struct for gps, so gps data can be easily accessed for use in functions. ​ This is the latest code. It uses struct for gps, so gps data can be easily accessed for use in functions. ​
   - The GPS nav mode check bug has been attempted to be fixed by re-ordering statements. ​   - The GPS nav mode check bug has been attempted to be fixed by re-ordering statements. ​
-  - The zeros after the decimal place bug has also been fixed, by converting the gps strings into char arrays in the GPS_Coord function. ​+  - The zeros after the decimal place bug has also been fixed, by converting the gps strings into char arrays in the GPS_Coord function. 
 +  - depend on NewSoftSerial library found [[http://​arduiniana.org/​libraries/​newsoftserial/​|here]]
 As much as possible all bugs have been eliminated, but this code has not been tested on an Arduino with a fully functioning GPS. However it has been beta tested using test strings on a static arduino uno.  As much as possible all bugs have been eliminated, but this code has not been tested on an Arduino with a fully functioning GPS. However it has been beta tested using test strings on a static arduino uno. 
-Using this code is at your own risk, and I recommend some ground testing first. ​+Using this code is at your own risk, and I recommend some ground testing first. If you want to use some existing code, or want to see fragments. See our dedicated code dump page [[weasel_code|here]]
  
-<code cpp>+<​code ​cpp tracker.cpp>
 // This code sets a FSA03 GPS module to give gps data to a radio module to downlink to earth. ​ // This code sets a FSA03 GPS module to give gps data to a radio module to downlink to earth. ​
  
Line 447: Line 448:
  
 </​code>​ </​code>​
- 
- 
 ===== C++ GPGGA to Char Arrays ​ ===== ===== C++ GPGGA to Char Arrays ​ =====
  
Line 598: Line 597:
  
 </​code>​ </​code>​
- 
-===== Archive ===== 
- 
  
  
Line 671: Line 667:
 {{https://​lh5.googleusercontent.com/​-_okrrjXgOkE/​TfvCmscXVxI/​AAAAAAAAAVU/​CRUWfjwJPWQ/​s400/​pyro.JPG}} {{https://​lh5.googleusercontent.com/​-_okrrjXgOkE/​TfvCmscXVxI/​AAAAAAAAAVU/​CRUWfjwJPWQ/​s400/​pyro.JPG}}
  
-the transistor used http://​www.fairchildsemi.com/​ds/​2N/​2N7000.pdf but could use any enhance mode transistor. +the transistor used [[http://​www.fairchildsemi.com/​ds/​2N/​2N7000.pdf|2N7000]] ​but could use any enhance mode transistor. 
-<code cpp>+<​code ​cpp cut-the-cord.cpp>
 int explode(int X, int Y); int explode(int X, int Y);
 void trigger(); void trigger();
Line 720: Line 716:
     if(!digitalRead(test_pin))result++; ​   //test weather successful     if(!digitalRead(test_pin))result++; ​   //test weather successful
 } }
 +
 </​code>​ </​code>​
  
Line 727: Line 724:
   - If Coordinate is 0.08912, it will show as 0.89120. This is due to a bug cause by storing the part after the decimal point as a separate integer. ​   - If Coordinate is 0.08912, it will show as 0.89120. This is due to a bug cause by storing the part after the decimal point as a separate integer. ​
  
-Both these bugs are corrected in the BETA code at the bottom ​of the page. This BETA code is probably betterand has been tested ​briefly with test strings, and bug 2 is fixed. However I have not tested that code with a real GPS chip, as the original board is stuck up a tree+Both these bugs are corrected in the latest release ​at the top of this page, or on the project main page. This code is retained primary for historical purposesor if people want a tested code. 
  
    
Line 919: Line 916:
  
          if (ew=='​W'​){ //Will put in the negative sign when in the Western Hemisphere. ​          if (ew=='​W'​){ //Will put in the negative sign when in the Western Hemisphere. ​
-         int a = sprintf(buffer,​ "​$$%s,​%ld,​%.2ld:​%.2ld:​%.2ld,​%ld.%ld,​-%ld.%ld,​%ld;%.2u,​\0",​ callsign, ticks, hour, minute, second, lat_big, lat_small, long_big, long_small, alt_int, sat);+         int a = sprintf(buffer,​ "​$$%s,​%ld,​%.2ld:​%.2ld:​%.2ld,​%ld.%ld,​-%ld.%ld,​%ld,%.2u,​\0",​ callsign, ticks, hour, minute, second, lat_big, lat_small, long_big, long_small, alt_int, sat);
          }          }
          else{          else{
-         int a = sprintf(buffer,​ "​$$%s,​%ld,​%.2ld:​%.2ld:​%.2ld,​%ld.%ld,​%ld.%ld,​%ld;%.2u,​\0",​ callsign, ticks, hour, minute, second, lat_big, lat_small, long_big, long_small, alt_int, sat);+         int a = sprintf(buffer,​ "​$$%s,​%ld,​%.2ld:​%.2ld:​%.2ld,​%ld.%ld,​%ld.%ld,​%ld,%.2u,​\0",​ callsign, ticks, hour, minute, second, lat_big, lat_small, long_big, long_small, alt_int, sat);
          }          }
           unsigned int checksum = CRC16Sum(buffer);​           unsigned int checksum = CRC16Sum(buffer);​
weasel_code.1310912068.txt.gz · Last modified: 2011/07/17 15:14 by chrism