Show Posts
Pages: [1] 2 3
1  Using Arduino / Programming Questions / gps to magnetic compass on: July 14, 2011, 12:16:40 pm
I am trying to convert my current gps coordinates and the desired gps coordinates to a compass heading.  I am trying to use the equations for the great circle. When I compile I am getting this error. error: invalid operands of types 'double' and 'double' to binary 'operator%'  I'm pretty sure it does not like my modulo operator, but because atan2 returns a value between -180 and 180 I need to use it.

Code:
double lat_gps, lon_gps, lat, lon;
float desired_heading;

          desired_heading =atan2(cos(lat_gps)*sin(lat)-sin(lat_gps)*cos(lat)*sin(lon-lon_gps),sin(lon-lon_gps)*cos(lat)); 
          desired_heading = (desired_heading*(180.0/3.14)+360.0) % 360.0;
          motor_control(desired_heading);
2  Using Arduino / Project Guidance / Re: Wireless video on: July 05, 2011, 12:22:04 pm
Im reading into that.  Would I be able to send signal back to the quadrotor with that or just receive data?
3  Using Arduino / Project Guidance / Re: Wireless video on: July 05, 2011, 12:10:14 pm
Most of the stuff I have seen for that sends analog video.  I was hoping to make it a digital signal that way I could also send some data back with it.
4  Using Arduino / Project Guidance / Re: Wireless video on: July 05, 2011, 11:34:01 am
I want to be able to control a uav - specifically a quad rotor.  I want to be able to control it from my computer, probably in lavVIEW.  It needs to be able to send back video at a distance of about two miles.
5  Using Arduino / Project Guidance / Re: Wireless video on: July 05, 2011, 11:21:15 am
I need to assume that the area has no 3g but great idea.

Sending anything resembling decent resolution images in anything resembling "real time" is WAY beyond the capacity of Arduino. Even if you don''t add digital data to the information stream. 

You can use Arduino and appropriate wireless modules for sending data, although your "2 miles" requirement will make it a rather difficult and expensive proposition. 

But sending video 2 miles will be an order of magnitude more difficult and expensive. If this is a fixed-point project (where both the transmitting and receiving end are stationary and carefully aimed at each other with large antennas), you might be able to pull it off depending on what the interference looks like in your neighborhood. This is not a simple (or inexpensive) thing to do.

What kind of processor would I need to use?  If money were not an issue could it be done-short of a satellite?
6  Using Arduino / Project Guidance / Re: Wireless video on: July 05, 2011, 12:48:54 am
What kind of high powered transmitter?  Would I be able to send the data digitally so that I could also send other data back such as altitude or orientation?
7  Using Arduino / Project Guidance / Re: Wireless video on: July 04, 2011, 12:43:03 pm
What kind of transmitter and receiver would I have to use to transmit that data aprx 2 miles.
8  Using Arduino / Project Guidance / Wireless video on: July 03, 2011, 07:51:19 pm
So I need a little guidance when it comes to videos or pictures (one every three seconds or so).  I would like to transmit them wireless, but from what I have read the arduino does not have the memory to do this and the xbee does not have the speed. 

In your expert opinions how would you do this?
9  Using Arduino / Programming Questions / Re: Control servo via serial on: July 01, 2011, 04:08:24 pm
In labview (number to decimal string) then in arduino atoi(serialreading)
10  Using Arduino / Programming Questions / Re: Out of Memory on: July 01, 2011, 03:49:13 pm
Wow I had no idea.  That solved my initial problem but I seem to have another.  Everything works correctly except the m command.  When I send that command all the info displays correctly, but it appears that the arduino resets after it completes this command.
11  Using Arduino / Programming Questions / progmem function on: July 01, 2011, 01:09:41 pm
I am working on creating a function that reads strings from progmem and serial prints them.  I am not sure what I am doing wrong but my function is spitting out every string in progmem all at once without printing the variable that follows.

Code:
#include <avr/pgmspace.h>

#define line 1
#define no_line 0

//speak function
prog_char string_0[] PROGMEM = "Finished Initializing Ready for commands";   // "String 0" etc are strings to store - change to suit.
prog_char string_1[] PROGMEM = "Temp(C):";
prog_char string_2[] PROGMEM = "Pressure(Pa):";
prog_char string_3[] PROGMEM = "Humidity ";
prog_char string_4[] PROGMEM = "Compass Heading = ";
prog_char string_5[] PROGMEM = " degrees";

PROGMEM const char *string_table[] =    // change "string_table" name to suit
{   
  string_0, string_1, string_2, string_3, string_4, string_5
};

void setup()
{
  Serial.begin(9600);
  //speak(0,1,line);
}
void loop()
{
  speak(1,1,no_line);
  Serial.println("21");
  speak(2,1,no_line);
  Serial.println("40000");
  speak(3,1,no_line);
  Serial.println("50");
  delay(3000);
}

void speak(int string_num, int num_strings, int ln)
{
  char write_buffer[44];
 
  if (ln = 0)
  {
    for (string_num; string_num <= string_num + (num_strings - 1) ; string_num++)
    {
      strcpy_P(write_buffer, (char*)pgm_read_word(&(string_table[string_num]))); // Necessary casts and dereferencing, just copy.
      Serial.print( write_buffer );
    }
  }
  if (ln = 1)
  {
    for (string_num; string_num <= string_num + (num_strings - 1) ; string_num++)
    {
      strcpy_P(write_buffer, (char*)pgm_read_word(&(string_table[string_num]))); // Necessary casts and dereferencing, just copy.
      Serial.println( write_buffer );
    }
  }
}
12  Using Arduino / Programming Questions / Re: Out of Memory on: June 30, 2011, 10:00:20 pm
I was under the impression that the doubles and floats were taking up the majority of the memory.

I only use the strings to parse the data out of them maybe I could just have one function to read in the variables I need and then set them back to null?
13  Using Arduino / Programming Questions / Out of Memory on: June 30, 2011, 05:09:39 pm
I think I am out of sram but i'm really not sure can anyone verify?

Code is attached it was to long to post.
14  Using Arduino / Motors, Mechanics, and Power / 11v source 3v motor? on: June 03, 2011, 03:39:37 pm
My DC motor is rated from 1.5v to 3v. I have an 11.1 volt battery to run the motor off of.  I have looked for a voltage regulator, but I can't find one that can handle the current (< 1.A).  Is it safe to run this directly off of the 11.1v source?

On a side not when I hook the motor up to a variable power supply it only lets me apply 4volts to it?
15  Using Arduino / Programming Questions / Re: 2-D array error invalid types 'char[int]' on: June 01, 2011, 03:31:05 pm
This is the solution. Thanks for the help.

Code:
  lat = atof(strtok(buffer_gpsg, ","));
  n_s =  *strtok(NULL, ",");
  lon = atof(strtok (NULL, ","));
  e_w =  *strtok(NULL, ",");
Pages: [1] 2 3