Show Posts
Pages: [1] 2 3 ... 9
1  Using Arduino / Project Guidance / Re: Accelerometer adaptation on: September 14, 2014, 06:12:02 pm
Yes, thank you that did solve my problem. I just overlooked the pads on my pro mini.
but he should have acknowledged that fact.

And sorry to not thank both of you for your help.
2  Using Arduino / Project Guidance / Re: Accelerometer adaptation on: September 11, 2014, 05:39:47 pm


Why ?

I need to use the accelerometer with an arduino pro mini and that does not have a SDA or SCL pin.
3  Using Arduino / Project Guidance / Re: Accelerometer adaptation on: September 11, 2014, 08:07:51 am
I got it to work but only when hooked up to SDA SCL lines of my arduino. I want to move those lines to say a digital pin. How would I do this?
4  Using Arduino / Project Guidance / Re: Accelerometer adaptation on: September 10, 2014, 07:49:35 pm
It looks like the break out has a serial and a clock pin. I am not sure how to set up a clock.
5  Using Arduino / Project Guidance / Accelerometer adaptation on: September 10, 2014, 06:25:13 pm
I recently came across a https://www.sparkfun.com/products/11770 and wanted to adapt it for my arduino. How would I go about doing this?
6  Using Arduino / Programming Questions / Re: Wireless Radio Communication on: September 08, 2014, 07:20:15 pm
I am looking at the virtual wire library specifically the transmitter and receiver examples and I cant find what pin I need to hook up the transmitter and receiver to, respectively.
7  Using Arduino / Programming Questions / Re: Wireless Radio Communication on: September 08, 2014, 06:26:53 pm
Thanks for the help, but how would I wire the receiver and transmitters if not to the TX and RX pins? Would I set them up with a digital pin and use the radio head library? Which library should I use?
8  Using Arduino / Programming Questions / Wireless Radio Communication on: September 06, 2014, 06:10:59 pm
Hey I am trying to set up a wireless link between this transmitter: https://www.sparkfun.com/products/10534 and this receiver:
 https://www.sparkfun.com/products/10532

I followed this tutorial: https://www.sparkfun.com/datasheets/RF/KLP_Walkthrough.pdf to get the link established and working however I can't seem to get it to work. I have the transmitter hooked up to an arduino uno on a 9v power supply and the receiver on a duemilnavo powered by my computer. When I tune it I get two instances where the serial line displays zero. I am really confused and could use help thanks for your time.
9  Using Arduino / Programming Questions / Re: Average coordinate points on: February 11, 2014, 10:49:30 pm
2 You are adding 6 readings, then dividing by 5.

the for loop is less than 6 so I think it makes five readings but no the six one because it is not equal to or less than

10  Using Arduino / Programming Questions / Re: Average coordinate points on: February 08, 2014, 11:07:22 pm
Thank you. But how would I collect multiple coordinate points and average them?
11  Using Arduino / Programming Questions / Re: Average coordinate points on: February 08, 2014, 10:12:04 pm
Code:
/*
 The circuit:
 * LCD RS pin to digital pin 9
 * LCD Enable pin to digital pin 8
 * LCD D4 pin to digital pin 7
 * LCD D5 pin to digital pin 6
 * LCD D6 pin to digital pin 5
 * LCD D7 pin to digital pin 4
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)
 
 http://www.arduino.cc/en/Tutorial/LiquidCrystal
 */

// include the library code:
#include <LiquidCrystal.h>
#include <math.h>

//#include <Servo.h>
#include <PWMServo.h>

#include <SoftwareSerial.h>
#include <TinyGPS.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(9, 8, 7, 6, 5, 4);
#define RXPIN 2
#define TXPIN 3
#define GPSBAUD 4800
TinyGPS gps;
SoftwareSerial uart_gps(RXPIN, TXPIN);
void getgps(TinyGPS &gps);

const float pi = 3.14;
float targetlat = rad(39.52);
float targetlong = rad(-104.92139);
float newlat = 0;
float newlon = 0;
int off = 11;

PWMServo myservo;
void setup() {
  myservo.attach(SERVO_PIN_B);
myservo.write(100);
pinMode(off, OUTPUT);
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  //Serial.begin(115200);
  uart_gps.begin(GPSBAUD);
  // Print a message to the LCD.
  lcd.print("waiting for lock");
  delay(1000);

}

void loop() {

  if(uart_gps.available())     // While there is data on the RX pin...
  {

    int c = uart_gps.read();    // load the data into a variable...
    if(gps.encode(c))      // if there is a new valid sentence...
    {
      lcd.clear();
      getgps(gps);         // then grab the data.
      delay(500);
    }

  }
}

void getgps(TinyGPS &gps)
{
  // To get all of the data into varialbes that you can use in your code,
  // all you need to do is define variables and query the object for the
  // data. To see the complete list of functions see keywords.txt file in
  // the TinyGPS and NewSoftSerial libs.

  // Define the variables that will be used
  float latitude, longitude;
  gps.f_get_position(&latitude, &longitude);
  /* THIS WAS THE SECTION I WAS USING TO FIND THE MEAN
  lcd.clear();
  for(int mean = 0; mean < 6; mean++){
  lcd.print("processing data");// Then call this function
  gps.f_get_position(&latitude, &longitude);
    unsigned long chars;
  unsigned short sentences, failed_checksum;
  gps.stats(&chars, &sentences, &failed_checksum);
  float newlat = newlat + latitude;
  float newlon = newlon + longitude;
  delay(1);
  }
  newlat = newlat/5;
  newlon = newlon/5;
  */
  float lat = rad(latitude);
  float lon = rad(longitude);
  float x = (lon-targetlong)*cos(targetlat);
  float y = lat-targetlat;
  float d = 3959*sqrt(sq(x)+sq(y));
  if(d <= .05)
  {
    lcd.clear();
    lcd.print("Congrats!");
    lcd.setCursor(0,1);
    lcd.print("target reached");
    myservo.write(180);
    while(1)
    {
    }
  }
  // You can now print variables latitude and longitude
  lcd.clear();
  lcd.print("Lat: ");
  lcd.print(latitude,5);
  lcd.setCursor(0, 1);
  lcd.print("long: ");
  lcd.print(longitude,5);

  // Here you can print statistics on the sentences.
unsigned long chars;
  unsigned short sentences, failed_checksum;
  gps.stats(&chars, &sentences, &failed_checksum);
  //Serial.print("Failed Checksums: ");Serial.print(failed_checksum);
  //Serial.println(); Serial.println();
  delay(5000);

  lcd.clear();
  lcd.print(d);
  lcd.setCursor(0, 1);
  lcd.print("Miles to target");
  delay(5000);
  lcd.clear();
  lcd.print("Turning off...");
  delay(2500);
digitalWrite(off, HIGH);


}

float rad(float n)
{
  float r = n*(pi/180);
  return r;
}

Are you certain that your math is correct? I'm not.
My math is semi-sound with a mock haversine formula. What formula does tiny gps use for its distance calculations?However, I still need to fix the mean problem.
12  Using Arduino / Programming Questions / Re: Average coordinate points on: February 06, 2014, 09:40:24 pm
I've tried a up and dividing them with a for loop but I get overflows on the float data type
13  Using Arduino / General Electronics / Re: Pro mini on: February 06, 2014, 03:49:30 pm
well if I removed the cap how would the performance of my arduino be affected? And it defiantly shorted out I took a multimeter to it to test.
14  Using Arduino / Programming Questions / Re: Average coordinate points on: February 06, 2014, 03:47:25 pm
Add them up and divide by the number of readings I would think.

A question for you.  How long does the program stay in this while loop ?
Code:
    while(1)
    {
    }

It stays in the while loop forever, and well how would I implement a mean or median into my code?
15  Using Arduino / General Electronics / Re: Pro mini on: February 06, 2014, 10:49:14 am
It shorted out when fried
Pages: [1] 2 3 ... 9