Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / Programming Questions / Re: Weird Problem on: March 18, 2014, 05:09:52 am
Thanks for your help, i tried it and found out you have to switch to 4800 after being 9600. Thank you.
2  Using Arduino / Programming Questions / Re: Weird Problem on: March 17, 2014, 07:01:06 pm
It seems almost the gps chip is now running at a different speed? Im totally confused.
3  Using Arduino / Programming Questions / Re: Weird Problem on: March 17, 2014, 05:43:40 pm
#include <SPI.h>
#include <avr/pgmspace.h>
#include <SoftwareSerial.h>
#include <TinyGPS_UBX.h>
#include <SD.h>

SoftwareSerial GPS_Serial(9, 8);
TinyGPS gps;

#define DEBUG true

byte gps_hour, gps_minute, gps_second;
long gps_lat, gps_lon;
unsigned long gps_fix_age;
int valid;

// no need to store these in the RAM anyway
static char str_buffer[25];
prog_char GPSstr_poll[] PROGMEM = "$PUBX,00*33";
prog_char GPSstr_setup1[] PROGMEM = "$PUBX,40,ZDA,0,0,0,0*44";
prog_char GPSstr_setup2[] PROGMEM = "$PUBX,40,GLL,0,0,0,0*5C";
prog_char GPSstr_setup3[] PROGMEM = "$PUBX,40,VTG,0,0,0,0*5E";
prog_char GPSstr_setup4[] PROGMEM = "$PUBX,40,GSV,0,0,0,0*59";
prog_char GPSstr_setup5[] PROGMEM = "$PUBX,40,GSA,0,0,0,0*4E";
prog_char GPSstr_setup6[] PROGMEM = "$PUBX,40,GGA,0,0,0,0*5A";
prog_char GPSstr_setup7[] PROGMEM = "$PUBX,40,RMC,0,0,0,0*47";
PROGMEM const char *str_table[] = {
  GPSstr_poll, GPSstr_setup1, GPSstr_setup2, GPSstr_setup3,
  GPSstr_setup4, GPSstr_setup5, GPSstr_setup6, GPSstr_setup7
File myFile;

void setup() {
  pinMode(4, OUTPUT);
  if (!SD.begin(4)) {
    Serial.println("Error With Card");
  Serial.println("we are go!");

void loop() {
  gps.crack_time(&gps_hour, &gps_minute, &gps_second, &gps_fix_age);
  gps.get_position(&gps_lat, &gps_lon, &gps_fix_age);
  char time[8];
  sprintf(time, "%02d:%02d:%02d", gps_hour, gps_minute, gps_second);
  Serial.print("time: ");
  //Serial.print("latitude: "); Serial.println(gps_lat, DEC);
  //Serial.print("longitude: "); Serial.println(gps_lon, DEC);
  Serial.print("latitude: ");
  Serial.println(gps_lat/100000.0, 5);
  Serial.print("longitude: ");
  Serial.println(gps_lon/100000.0, 5);
  Serial.print("altitude: ");
  Serial.print(gps.altitude()/100.0, 0);
  Serial.println(" m");
  //Serial.print("speed: "); Serial.print(gps.speed()/100.0, 0); Serial.println(" km/h");
  Serial.print("speed: ");
  Serial.print(gps.f_speed_kmph(), 2);
  Serial.println(" km/h");
  Serial.print("vert. speed: ");
  Serial.print(gps.vspeed(), DEC);
  Serial.println(" cm/s");
  Serial.print("bearing: ");
  Serial.println(gps.course()/100, DEC);
  Serial.print("satellites: ");
  Serial.println(gps.sats(), DEC);
  Serial.print("has fix: ");
  Serial.println(gps.has_fix(), DEC);
  Serial.print("fix quality: ");
  Serial.println(gps.fix_quality(), DEC);
  Serial.print("fix age: ");
  Serial.println(gps_fix_age, DEC);

  myFile ="data.csv", FILE_WRITE);

  if (myFile) {
    Serial.println("Writing Data ....");
    myFile.print(gps_lat/100000.0, 5);
    myFile.println(gps_lon/100000.0, 5);
  else {
    // if the file didn't open, print an error:
    Serial.println("Failed to write to file.");


void GPS_setup() {
  // switch baudrate to 4800 bps


  // turn off all NMEA sentences for the uBlox GPS module
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[1])));
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[2])));
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[3])));
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[4])));
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[5])));
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[6])));
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[7])));


// request uBlox to give fresh data
boolean GPS_poll() {
  GPS_Serial.println(strcpy_P(str_buffer, (char*)pgm_read_word(&str_table[0])));
  unsigned long starttime = millis();
  while (true) {
    if (GPS_Serial.available()) {
      char c =;
      if (gps.encode(c))
        return true;
    // that's it, can't wait any longer
    // i have short attention span..
    if (millis() - starttime > 1000) {
  return false;
4  Using Arduino / Programming Questions / Weird Problem on: March 17, 2014, 05:22:35 pm
I have just got working a 6mv2 GPS Working. It works with a modified tinygps library which I found online.
I was able top out put the lat long of the co ord of my house. QUite cool.

Today I turned on my device and it was timing out constantly. I swapped RX TX several times with still no luck. I then decided to use two differnt pins (went from 10 and 11) to 8 and 9. Now i can get data back. But I get a load of rubbish. eg:
« ¹¾­))IZj+Jé©h:øó”V!•Bé)Œ


Now I tried other IO pins with the software serial and still hit the same problem. Another problem I have noticed I get time out when switching the RX and TX wires with software also switched. I am not too sure whats gone wrong ? (software serial running at 4800).
5  Using Arduino / Installation & Troubleshooting / Arduino Mega 2560 Screw LayOut on: October 24, 2013, 06:13:06 pm
On the standard arduino drawing for the 2560, The most right bottom screw has no x position drawing. I am creating a file for a laser cutter using a very basic drawing package. Hereis it so far:

That bottom screw I know fits up 2.5mm, but how far across does it go? Thank you all!

Standard image:
6  Using Arduino / Installation & Troubleshooting / Might of broken my arduino leonardo in under a minute. on: September 06, 2013, 02:52:54 pm
I got my new arduino! I quickly uploaded this:

void loop()

How can I freeze the controller to a state where I can program over it? Thanks
7  Using Arduino / LEDs and Multiplexing / Re: Led Pixel on: June 15, 2013, 05:12:11 pm
OK, I couldn't handle that the LEDs were on the floor just waiting for an upload. Tried them with the 6803 on the fastSPI library. They seem to be fully operational.


Even through this post I felt the need to create a quick pattern. (: I may create my first video On how to get these working. I haven't found many on youtube that explain these in depth. I might go into the detail on what you need to do. Ensure what pixels you get etc.

I wonder on what to create! I might install these on something cool first! Or get some more!
8  Using Arduino / LEDs and Multiplexing / Re: Led Pixel on: June 15, 2013, 04:27:51 pm
Thank you for the replies! So after trying various different codes and failing, I decided to contact the seller. Luckily he actually knew what he was selling which was great smiley-wink turns out that actually, they are LPD5903. Looking desperately through google I came back to the FastSPI library used in other modules.

Searching the page ctrl f "5903" I find this comment:

I'm currently using an Arduino Uno, IDE V1.0, to drive a string of 550 LPD6803-like RGB leds (Actual chip says UCS5903 but it drives as for LPD6803) and it's working brilliantly.

So thank you fexduino! I will have a look at the material you have supplied me tomorrow. As I am currently half through the hobbit!

I really do hope this works! Last time I did something like this for a GLCD and I could never get it working. This time i spent quite a bit of money assuming the ws8021 was being used! :S
9  Using Arduino / LEDs and Multiplexing / Led Pixel on: June 13, 2013, 09:59:55 am
HEllo all, i bought some LED pixels of the internet, I cant seem to get the ws2081 library to work.

Just to make sure would anyone know what interface/chip used on these LEDs I bought?
10  Using Arduino / Programming Questions / Re: Quick question VB and Arduino Serial. on: June 02, 2013, 02:10:59 pm
Interesting point. I have to say it isnt an official arduino mini. I bought it of the internet. Its an atmega 328 smd chip. Using the most up to date IDE. I am able to program it on ..... OK half way writing this code. I tried a new arduino min 328 And it looks like it is working. I didnt imagine something like this happening!

So I guess, for those reading, you can upload an image to the arduino board with the different board selected. Though the serial write backs will not be at the speed you originally dictate. Thank you to all those who helped! Here is the outcome:
11  Using Arduino / Programming Questions / Re: Quick question VB and Arduino Serial. on: June 02, 2013, 01:41:33 pm
Ive tried various boards, all with the same result :/
12  Using Arduino / Programming Questions / Re: Quick question VB and Arduino Serial. on: June 02, 2013, 12:15:18 pm
Thank you for the reply, I tried your recommendation. Still the similar problem is occurring.  smiley-sad What do you think ?
13  Using Arduino / Programming Questions / Re: Quick question VB and Arduino Serial. on: June 02, 2013, 11:46:43 am
No luck on getting the message to come out properly :/ Quite frustrating!
14  Using Arduino / Programming Questions / Re: Quick question VB and Arduino Serial. on: June 02, 2013, 11:21:33 am
Thank you for the reply, Interesting, I have to say I have never seen this before.

So Not using VB The serial monitor is giving a similar result. I am using a Arduino 328 with a FTDI serial controller.
Here is an image:

i also change the baud rate with no affect.
15  Using Arduino / Programming Questions / Quick question VB and Arduino Serial. on: June 02, 2013, 10:59:24 am
Sorry for bugging this forum with stupid question. Attempting to interface computer with arduino.

Here is an image, it pretty much shows everything:

At the moment, I thought that either I should be seeing "a" back or 48 but why this zþ. Thank you.

My guess: MScomm1.input returns back a data type I am not familiar too.

Can someone briefly explain whats gone wrong? Thank you all, one day I may actually contribute I swear! smiley
Pages: [1] 2 3 ... 6