Show Posts
Pages: [1] 2 3 ... 15
1  Using Arduino / Networking, Protocols, and Devices / Re: Connecting my GPS to the Arduino on: July 24, 2014, 10:41:25 am
The file should be in  , program files/arduino/libraries/SoftwareSerial/
Found it. The value entered was all ready 64. Changed that to 128 with no result.
So i took the softwareSerial terminal example to see if it was working.
And there was data on the terminal output.

Looking at the difference between the two sketches, the major item was the baudrate. In all the GPS examples the baudrate is 4800 and in the terminal example it was 9600. So chaged it in the GPS to 9600 and there was data received.
Now waiting to get 3 sats in view at the office windows. The receiver is outside now.

Now i have to solve the problem to get the GPS output also to the UNO USB to analyze it with the U-BLOX program.
2  Using Arduino / Networking, Protocols, and Devices / Re: Connecting my GPS to the Arduino on: July 24, 2014, 04:09:01 am
Some people have had problems with the serial receive buffer being too small to hold the whole message. You may want to edit this line in SoftwareSerial.h:
Code:
#define _SS_MAX_RX_BUFF 64 // RX buffer size
I did a search on my HD but cant find this file. Where is it located?
3  Using Arduino / Networking, Protocols, and Devices / Re: Connecting my GPS to the Arduino on: July 24, 2014, 03:54:43 am
What Arduino board are you using?
Arduino UNO
4  Using Arduino / Networking, Protocols, and Devices / Re: Connecting my GPS to the Arduino on: July 23, 2014, 09:39:19 am
Yes, if i look at it using the USB connection to my PC and U-BOX, all the data is visible and several satellites. are listed.
First i thought that RX and TX where not connected correctly but when changing the connection the sketh reported no GPS device found.

Harry
5  Using Arduino / Networking, Protocols, and Devices / Connecting my GPS to the Arduino on: July 23, 2014, 07:54:22 am
I am trying to get the examples included to the TinyGPS++ library working with no result.
Using the http://www.dfrobot.com/index.php?route=product/product&filter_name=usb%20xbee&product_id=72#.U3UV4Sjqgvg adapter and the http://www.seeedstudio.com/depot/GPS-Bee-kit-with-Mini-Embedded-Antenna-p-560.html GPS XBEE on it.

If i connect the USB cable i see all the data coming from the unit but when connecting to my Arduino there's nothing displayed.
This is ther skertch:
Code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>
#include <TinyGPS++.h>

const int offet_utc=2;
static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 4800;

// The TinyGPS++ object
TinyGPSPlus gps;
// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);
//LiquidCrystal_I2C lcd(0x20, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
LiquidCrystal_I2C lcdSerial(0x20, 20, 4);

void setup()
{
  Serial.begin(115200);
  ss.begin(GPSBaud);
  lcdSerial.init();             // Initialize LCD and turn backlight on
  lcdSerial.backlight();

  Serial.println(F("WRX-1700 SatStation Tracker"));
  lcdSerial.print(F("SatStation Tracker"));
  Serial.println(F("by Harry H. Arends"));
  Serial.println();
}

void displayInfo()
{
    if (gps.location.isValid())
    {
        if (gps.location.isUpdated())
        {
            lcdSerial.setCursor(0, 0);
            lcdSerial.print(F("Lat: "));
            lcdSerial.setCursor(5, 0);
            lcdSerial.print(gps.location.lat(),6);
       
            lcdSerial.setCursor(0, 1);
            lcdSerial.print(F("Long: "));
            lcdSerial.setCursor (6, 1 );
            lcdSerial.print(gps.location.lng(),6);
        }

        if (gps.satellites.isUpdated())
        {
            lcdSerial.setCursor(0, 2);
            lcdSerial.print(F("Satellites:     "));
            lcdSerial.setCursor(12, 2);
            lcdSerial.print(gps.satellites.value());
        }
           
        lcdSerial.setCursor(0, 3);
        int uren;
        uren = gps.time.hour() + offet_utc;
        if (uren >= 24)
        {
            uren -= 24;
        }
        char buffer[17];
        sprintf(buffer, "Tijd: %02d:%02d:%02d", uren, gps.time.minute(), gps.time.second());
        lcdSerial.print(buffer);
    }
    else
    {
        lcdSerial.clear();
        lcdSerial.print(F("No data available"));
    }
}

void loop()
{
    while (ss.available() > 0)
    {
        if (gps.encode(ss.read()))
        {
            displayInfo();
        }
    }
    if (millis() > 10000 && gps.charsProcessed() < 10)
    {
        lcdSerial.clear ();
        lcdSerial.print(F("No GPS detected."));
        while(true);
    }
}
The only output on the LCD visable is No data available. This indicates that there is data coming from the unit.
Anny suggestions?

Harry
6  Using Arduino / Networking, Protocols, and Devices / Displaying xbee received character to LCD on: May 15, 2014, 02:36:58 pm
Using the dfrobot interface http://www.dfrobot.com/index.php?route=product/product&filter_name=usb%20xbee&product_id=72#.U3UV4Sjqgvg i wanted to test the combination xBee ==> LCD (I2C)

the program should display the xbee received characters on the LCD.
But thers nothing visible on the LCD.
The connected LCD is working (Tested with a different sketch) and the two used  xBee's  are communicating with each other (Tested with two x-ctu terminals.

Code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>
#define rxPin 2
#define txPin 3
#define ledPin 13
SoftwareSerial xbee =  SoftwareSerial(rxPin, txPin);

LiquidCrystal_I2C lcd(0x20,16,2);  // set the LCD address to 0x20 for a 16 chars and 2 line display

void setup()
{
  lcd.init();                      // initialize the lcd
  lcd.backlight();
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  xbee.begin(19200);
  Serial.begin(9600);
}

void loop()
{
  // when characters arrive over the serial port...
  if (Serial.available()) {
    while (xbee.available() > 0) {
      // display each character to the LCD
      lcd.write(xbee.read());
    }
  }
}

Anny suggestions on how to get this running
7  Using Arduino / Networking, Protocols, and Devices / Need help on setting up two RN171 modules on: May 13, 2014, 03:31:04 pm
I have a Arduino thats controlled bij a Serial cable and i am looking to change this to Wireles.
Therefore i have got two RN-XV units and two USB interfaces.
I managed to update the Firmware to version 4.41.

The first one i configured as a AP and the other one as a client.
On the AP the green led is blinking at a one second interval.
On the client is blinking much faster.

But if i send serial data to the AP cant see anything on the serial from the client.
Anny suggestions or the direction to a good tutorial.

Harry
8  Using Arduino / Networking, Protocols, and Devices / XBEE two way communication? on: May 12, 2014, 07:59:23 am
Is it possible to have two XBEE's + Arduino's communicate with each other  both ways?

All the examples i see go from one bee to the other.

Harry
9  Products / Arduino Yún / Want to changer the IP from the Yún WiFi on: March 14, 2014, 06:06:08 am
I am trying to change the IP as described here http://arduino.cc/en/Guide/ArduinoYun#toc13 but with no luck.
My laptop runs on Windows8.
The Yún is connected true the USB cable.

If i try to connet to the Yún using my laptop, the device is shown in the available connections list, i get a warning that there are only limited services available for that connection. It has the IP address 192.168.240.222.

But if i do a Ping to the Yún on 192.168.240.1 i get no reaction.

Is this normal or am i doing something wrong or is there a problem with my configuration?

Harry
10  Using Arduino / Programming Questions / Re: Reverse calculation gives wrong result on: March 07, 2014, 01:30:55 pm
The results not wrong you are. The C language has been around since the 1970's and gcc the (compiler used by the IDE) has been around for many years - so any bugs which a newbie would find are long gone!

Converting (casting) to int allways rounds down.

Mark
But where do i convert to a int?
11  Using Arduino / Programming Questions / Re: Reverse calculation gives wrong result on: March 07, 2014, 01:29:28 pm
Shouldn't xResult be a float ?
No not according to the AccelStepper library documentation, it should be a long.
http://www.airspayce.com/mikem/arduino/AccelStepper/classAccelStepper.html#ace236ede35f87c63d18da25810ec9736
12  Using Arduino / Programming Questions / Reverse calculation gives wrong result on: March 07, 2014, 11:38:31 am
In the code below i first calculate the number of steps a stepper should step according to the degrees value.
Code:
char     xDishBuffer[8]     = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

int      xGearRatio        =  42;          // stepper ratio per X degree of rotation (1:42)
int      xMicroSteps       =   2;          // Value of the microsteps
                                                         // Posible value's are 1, 2, 4, 8 and 16

typedef enum {
  X_ROTOR, Y_ROTOR
}
stepperfn;

long deg2step( float degrees, stepperfn stepper );
long deg2step( float degrees, stepperfn stepper ) {
  if (stepper == X_ROTOR) return (( degrees / 1.8) * xMicroSteps * xGearRatio);
  if (stepper == Y_ROTOR) return ((-degrees / 1.8) * yMicroSteps * yGearRatio);
}

long xResult = 0;
float xxResult ;

void setup() {
  Serial.begin(19200);                     // Start the Serial communication
  while (!Serial);

  xResult = deg2step(99.99, X_ROTOR);
  Serial.println(xResult);

  xxResult = xResult / xGearRatio / xMicroSteps * 1.8;
  dtostrf(xxResult, 7, 2, xDishBuffer);  // Make it alse printable
  Serial.println(xDishBuffer);
}

void loop() {
  // put your main code here, to run repeatedly:

}
With 99.99 degrees the result = 4666(.2) steps.
If i reverse the calculation the result should be almost equals 99.99 but printed is 99.00.

Maybe i use the wrong types but how to solve this?
13  Using Arduino / Motors, Mechanics, and Power / How to reset when external power is switched on on: March 07, 2014, 08:08:59 am
The problem is as follows, The Arduino is powered true its USB connection where the DTR connection is taken out the equation.
This is due that every time under windows8, when a USB device is connected/disconnected, the Arduino would reset.

The Arduino controls two steppers and there is no feedback on their position other than several limit switches.
Both steppers are powered by a power supply and has no connection to the Arduino, the steering interface is true OPTO.

But the problem is that is the main power is interrupted when the steppers should move, the possition in the Arduino would be different from the actual position.
So what i need is a means to tell the Arduino to reset after a power fail.
Any suggestions are welcome.

Harry
14  Using Arduino / Programming Questions / Emergency stop with AccelStepper on: March 07, 2014, 07:57:55 am
As i am trying to include a emergency stop imy sketch i do ran into a problem with the AccelStepper libray.

It has the function stepper.stop() with stops the stepper as fast as possible.
In m.h.o. that would be a direct stop as i want to use it as a emergency stop if the movement runs into a limit switch.
But is doesn't, its slows down and then stops.

Any suggestions how to solve this problem?

Harry
15  Using Arduino / Programming Questions / Re: Wire requestFrom compiler problem on: March 05, 2014, 04:24:27 pm
Hi M<ark,

What i don't understand is the fact that i used this for the I2C RTC1307 and the I@C serial as wel and that works fine.

Harry
Pages: [1] 2 3 ... 15