Show Posts
Pages: [1]
1  Using Arduino / Installation & Troubleshooting / Re: NO USB Serial Port von Mac OSX 10.7.3 on: March 19, 2012, 12:14:54 am
SOLVED!!!!

go download a older version for mac osx like arduino 020 or something in the DMG file there is a ftdi install and enjoy.

oh yeah go in tools > serial port > and select ur usb port
2  Using Arduino / Installation & Troubleshooting / Re: NO USB Serial Port von Mac OSX 10.7.3 on: March 18, 2012, 11:53:40 pm
i am just getting back into my arduino after updating to 10.7.3 and i too am missing my com ports only bluetooth ones. im using seeduino mega

under system report > USB > does show FT232R USB UART

is it a driver problem?
3  Using Arduino / Sensors / Re: radio control reciever spektrum ar6100 ar6200 signal noise on: January 05, 2012, 03:38:43 am
Yes u need pwm ports cause the signal varies in length. The problem I was getting is that the measurement of e length of signal varied pretty drastically while reading to the point that if I were to use them the program would just be jittery and frankly very hard to use. Thanx for the links but I have read those. I have used a smoothing algorithm to smoothe the signals but unfortubately it makes the programs response laggy and very unsmooth when user input is attempted.
4  Using Arduino / Sensors / radio control reciever spektrum ar6100 ar6200 signal noise on: January 31, 2011, 03:01:25 am
hey all has anyone used pulseIn() to read signals from a RC rx like spektrums since they dont use ppm signals im trying to just read the pulses. im having trouble getting a clean signal it seems to want to just jump around. this wasnt a problem for me till now that im trying to be a little more accurate with the data and the jumping even if i apply digitalsmooth() to the data still wont get me where i need to be. any suggestions here is my code.

Code:
#define TIMEOUT 100

// { roll, pitch, yaw }
float angles[3] = {0.0, 0.0, 0.0};

#include <Servo.h>
Servo motor1;
int pos = 0;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int pin6 = 6;
int pin7 = 7;
int pin8 = 8;
int pin9 = 9;
int pin10 = 10;
int pin11 = 11;
int threshold = 30; //threshold for smoothing Rx data
int uGear = 0, uYaw = 0, uPitch = 0, uRoll = 0, uThrtl = 0,uGear1 = 0, uYaw1 = 0, uPitch1 = 0, uRoll1 = 0, uThrtl1 = 0;


void setup() {
  Serial.begin(57600);
  Serial1.begin(57600);
  motor1.attach(8);
  pinMode(pin3, INPUT);
  pinMode(pin4, INPUT);
  pinMode(pin5, INPUT);
  pinMode(pin6, INPUT);
  pinMode(pin7, INPUT);
}

void loop() {


  uThrtl = pulseIn(pin3, HIGH);
  uRoll = pulseIn(pin4, HIGH);
  uPitch = pulseIn(pin5, HIGH);
  uYaw1 = pulseIn(pin6, HIGH);
  uGear = pulseIn(pin7, HIGH);

 
  Serial.print("Throttle: ");
  Serial.print(uThrtl); //throttle 
  Serial.print("Yaw: ");
  Serial.print(uYaw);
  Serial.print("Pitch: ");
  Serial.print(uPitch);
  Serial.print("Roll: ");
  Serial.print(uRoll);
  Serial.print("Gear: ");
  Serial.print(uGear);
  Serial.println("");
}
5  Forum 2005-2010 (read only) / Troubleshooting / Re: serial.read() and pulseIn() not compatible? on: January 20, 2011, 02:35:07 pm
your right it is the buffer. the Serial.flush() is the route im going in it works great thanx all!
6  Forum 2005-2010 (read only) / Troubleshooting / Re: serial.read() and pulseIn() not compatible? on: January 20, 2011, 12:36:52 am
with the delay code in and ur suggestion the baud rate doesnt seem to change also i cant change the baud rate from the sparkfun board otherwise it breaks
7  Forum 2005-2010 (read only) / Troubleshooting / Re: serial.read() and pulseIn() not compatible? on: January 20, 2011, 12:24:03 am
actually after getting completely frustrated i started from square one.

i just used this basic code

Code:
#define TIMEOUT 100

// { roll, pitch, yaw }
float angles[3] = {0.0, 0.0, 0.0};



void setup() {
  Serial.begin(57600);
  Serial1.begin(57600);
  Serial.println("STARTING UP!!!");
  Serial.println("STARTING UP!!!");
  Serial.println("STARTING UP!!!");
  Serial.println("STARTING UP!!!");
  Serial.println("STARTING UP!!!");
  Serial.println("STARTING UP!!!");
  Serial.println("STARTING UP!!!");
  Serial.println("STARTING UP!!!");
  Serial.println("STARTING UP!!!");
  Serial.println("STARTING UP!!!");
  Serial.println("STARTING UP!!!");
}

void loop() {
  read_9dofahrs();

  Serial.print(angles[0]);
  Serial.print(" | ");
  Serial.print(angles[1]);
  Serial.print(" | ");
  Serial.print(angles[2]);
  Serial.println("");
  delay(100);
}


char read_char() {
  unsigned long starttime = millis();
  do {
    if(Serial1.available() > 0)
      return((char)Serial1.read());
  } while((millis() - starttime) < TIMEOUT);
  return NULL;
}

void get_angles() {
  for(int n=0; n<3; n++) {
    char buffer[9];
    int received = 0;
    char ch;
    do {
      if((ch = read_char()) == NULL) return;
    } while(ch != ',' && ch != '\r' && (buffer[received++] = ch));  
    buffer[received] = '\0';
    angles[n] = atof(buffer);
  }
}

void read_9dofahrs() {
  char beginstr[6] = {'!','A','N','G','\:','\0'};
  for(int i=0; i<5; i++)
    if(read_char() != beginstr[i]) return;
  get_angles();
}

now i put the delay in the code to imitate some pulse reads. with the delay the board resets without the code it works fine.
8  Forum 2005-2010 (read only) / Troubleshooting / serial.read() and pulseIn() not compatible? on: January 19, 2011, 01:06:28 am
hey all my first post and it just so happens to be a problem im having. i have a arduino mega and a sparkfun 9DOF and a spektrum RC reciever.

im am reading  the serial from the sparkfun board just fine but then i add the pulseIn()'s for reading my spectrum RX and then it seems to not let me read the serial from the Sparkfun board. is there something im doing wrong ive google the forums and can find anyone else with this problem.

im thinking the problem is when reading the pulse's its taking too much time and not synching with the serial read from the sparkfun board.

anyone have any ideas or work around?

heres my code

Code:
#define TIMEOUT 100

// { roll, pitch, yaw }
float angles[3] = {0.0, 0.0, 0.0};

#include <Servo.h>
Servo motor1;
int pos = 0;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int pin6 = 6;
int pin7 = 7;
int pin8 = 8;
int pin9 = 9;
int pin10 = 10;
int pin11 = 11;

void setup() {
  Serial.begin(57600);
  Serial1.begin(57600);
  motor1.attach(8);
  pinMode(pin3, INPUT);
  pinMode(pin4, INPUT);
  pinMode(pin5, INPUT);
  pinMode(pin6, INPUT);
  pinMode(pin7, INPUT);
}

void loop() {
  int uGear, uYaw, uPitch, uRoll, uThrtl;

  uGear = pulseIn(pin3, HIGH);
  uYaw = pulseIn(pin4, HIGH);
  uPitch = pulseIn(pin5, HIGH);
  uRoll = pulseIn(pin6, HIGH);
  uThrtl = pulseIn(pin7, HIGH);
  
  read_9dofahrs();
    
  
//  Serial.print("Gear: ");
//  Serial.print(uGear);
//  Serial.print("Yaw: ");
//  Serial.print(uYaw);
//  Serial.print("Pitch: ");
//  Serial.print(uPitch);
//  Serial.print("Roll: ");
//  Serial.print(uRoll);
//  Serial.print("Throttle: ");
//  Serial.print(uThrtl); //throttle
//  Serial.println("");

  Serial.print(angles[0]);
  Serial.print(" | ");
  Serial.print(angles[1]);
  Serial.print(" | ");
  Serial.print(angles[2]);
  Serial.println("");
  
  pos = abs(angles[0]);
  //Serial.println(pos);
  

  motor1.write(pos);
}

char read_char() {
  unsigned long starttime = millis();
  do {
    if(Serial1.available() > 0)
      return((char)Serial1.read());
  } while((millis() - starttime) < TIMEOUT);
  return NULL;
}

void get_angles() {
  for(int n=0; n<3; n++) {
    char buffer[9];
    int received = 0;
    char ch;
    do {
      if((ch = read_char()) == NULL) return;
    } while(ch != ',' && ch != '\r' && (buffer[received++] = ch));  
    buffer[received] = '\0';
    angles[n] = atof(buffer);
  }
}

void read_9dofahrs() {
  char beginstr[6] = {'!','A','N','G','\:','\0'};
  for(int i=0; i<5; i++)
    if(read_char() != beginstr[i]) return;
  get_angles();
}
Pages: [1]