Show Posts
Pages: [1] 2 3 ... 8
1  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Problem with Serial on Arduino Pro 328 3.3V 8MHz on: June 27, 2009, 03:53:42 pm
Today i was testing a prototype using 328 and 8MHZ. I was pulling my hairs!!! I quickly realize that was a problem in the bootloader. Anyway i google "Arduino Bootloader 328 8mhz problem" and i've found this.

I tried the solutions and works great now!!

Thanks!  smiley
2  Forum 2005-2010 (read only) / Syntax & Programs / Re: Float value through Serial Port.. on: April 06, 2008, 07:57:22 am
Super thanks now is working =)... And learn something new =)

But i found a very hidden option in the IMU that send you the float variables, but as "long int", for example if you have axis in degrees originally like this: 63.0982 (float), you can change the format and receive it like this "630982", and is easier to concatenate  and easier to process for the MCU..

Thanks a lot!!!  smiley-grin
3  Forum 2005-2010 (read only) / Syntax & Programs / Re: Float value through Serial Port.. on: April 04, 2008, 03:24:48 pm
Ok.. ok... about the "union" function i need any library to do this???
4  Forum 2005-2010 (read only) / Syntax & Programs / Re: Float value through Serial Port.. on: April 04, 2008, 03:22:53 pm
mmmh.. ok.......  :-? ????
Thanks for the answer but at first view i'm very confused about that function.. Now i have two questions hehe  smiley-grin ..

Another easy way, or an example of the code above? please...  :smiley
5  Forum 2005-2010 (read only) / Syntax & Programs / Float value through Serial Port.. on: April 03, 2008, 12:13:57 pm
Hello, i'm decoding an IMU (Xsens), which send me float values (in 4 bytes) thru the UART port.

Ok im receiving all the bytes correctly, but how i can concatenate this 4 bytes in a float variable?

I tried in the traditional mode ( variable << 8 , etc, etc), but i can't, well arduino don't let me  smiley-razz ...

Please help me... Thanks =)

BTW the floats are IEEE 754 standard...
6  Forum 2005-2010 (read only) / Syntax & Programs / Re: Binary serial communication on: April 04, 2008, 01:48:57 am
Well the only way i know to send raw bytes is doing this:

Serial.print(byte(0xFF)); //Where 0xFF is the byte in hex you want to send

or

byte Variable=0x00; //declaring a byte


Serial.print(Variable); //Print it... i Don't remember if arduino chage it, so in case of yes just put the Serial.print(byte(Variable));
7  Forum 2005-2010 (read only) / Syntax & Programs / Re: Arduino R/C HELP!!!!! on: November 06, 2007, 01:37:14 am
thanks for the post of the Microsecond interrump?, Now i able to read the signals coming from my RC controller with my arduino, here is the way how i made it, support now the reading of two Axis, as the same time, i think is possible to read a more: Good Look to everyone!!!  ;D

This code is for remote control the arduino with a conventional RC controller, like futaba, etc. I connected the central circuit of my RC helicopter to arduino (were suppose to be connected the servos) to digital pin 7 for axis "X" and digital pin 8 for axis "Y".

int xPin = 7;          //Pin IN of servo Axis X
int yPin = 8;          //Pin IN of servo Axis Y
int timeX = 0;  //Show the readed control position
int timeY = 0;
long lastPulseX = 0;    // the time in milliseconds of the last pulse
long lastPulseY = 0;
long mstime = 0;     // reads the time in miliseconds
long hptime = 0;     // Reads the time in Microseconds

extern volatile unsigned long timer0_overflow_count;

unsigned long hpticks (void)
{
  return (timer0_overflow_count << smiley-cool + TCNT0;
}

void setup() {
  Serial.begin(9600);
  pinMode(xPin, INPUT); //The R/C signal pin as an input pin
  pinMode(yPin, INPUT);
}
void loop() {

  if(millis() - lastPulseX >= 5) //Read Axis X every 5 milis
  {
    while(!digitalRead(xPin) == HIGH) //Waits for signal coming from axis X
    {
      continue;
    }
    mstime = millis();
    hptime = hpticks()*4; //When the signal arrives, here we going to record the start time of reciving
    while(!digitalRead(xPin) == LOW){
      continue;
    }
    mstime = millis();
    timeX = (hpticks()*4) - hptime;  //Here takes the diferences of  the Start and finish times, the result is the signal from RC.
    Serial.println(timeX); //Print the results
    Serial.print ("\t");
    hptime = 0;
    lastPulseX = millis();
  }  

  ///////////////////////////The same, but now for axis Y

  if(millis() - lastPulseY >= 5)
  {
    while(!digitalRead(yPin) == HIGH){
      continue;
    }
    mstime = millis();
    hptime = hpticks()*4;
    while(!digitalRead(yPin) == LOW){
      continue;
    }
    mstime = millis();
    timeY = (hpticks()*4) - hptime;    
    Serial.print(timeY);  
    Serial.print ("\t");
    hptime = 0;
    lastPulseY = millis();
  }  
}
8  Forum 2005-2010 (read only) / Syntax & Programs / Re: Arduino R/C HELP!!!!! on: November 04, 2007, 11:51:18 pm
could be a serial Trans. problem?
9  Forum 2005-2010 (read only) / Syntax & Programs / Arduino R/C HELP!!!!! on: November 04, 2007, 07:06:31 pm
ok, im trying to use a RC helicopter circuit board to remote control my arduino, the board is connected to a digital input in the arduino (were suppose to be a servo) i can read successfully the signals sended by the remote control, i used "reverse engineering" of the code, that control a servo, to read with arduino like a servo do, a ITS WORKS, yeahh!, but the problems is that i only be able to read just 1 axis, if write a second part of the code to read a second pin Input, the system crash, i made every kind of test, and nothing, the only thing i only know is that i need to use the interrupt function , suggestions? sorry for my English, i tried to post in the spanish version of the forum, but nobody answer me smiley-sad, ok the code is :

By the way, im trying to make an RC helicopter, estabilized by arduino using accelerometers, an able to move with the RC control, but smoothly smiley, off course ill post my results, pics and code.

///////////INputs
int xPin = 2;          //Input pin of Axis X
/////////
int time = 0;  //counter in microseconds
int lock = 0;  //locks code sequences , to improve performance
int pulse = 0; //store the readed pulse of the remote control, to use it letter.

void setup() {
  pinMode(xPin, INPUT); //put the pin as an input
  Serial.begin(9600); // start com. With the PC
}
void loop()  
{
  readX(); //Read Axis X, thats is connected to Pin 4
}
////////////////////////////////////////////////////////////////////////////////

void readX()
{
  if(digitalRead(xPin) == HIGH) //See if the Input is in High
  {  
    do //Start Loop to count the width of the signal
    {
     time = time + 1;  //is the counter, incremenet every micro second  
     delayMicroseconds(1);  //Delay
    }
    while(digitalRead(xPin) == HIGH); //The loops repeat, over and over, until the Input get LOW state.
    lock = 1; // Unlock the next part of the code, i dont why exactly, but this improve the code A LOT
  }
 
  if((digitalRead(xPin) == LOW)& (lock == 1))//Initiate only when the state is in LOW, and is Unlocked
  {    
    Serial.print("RC-X:"); //Print text to the PC
    Serial.println(time); //Print the value to the PC
    pulse=time;  //save the value to use it next
    time = 0; //restart the clock counter
    lock = 0; // Lock again the code.
  }
}

if you connect a circuit board of a RC airplane or whatever, you will be able to read the signal, the problem is: if you want to read 2 signals, is impossible. HELP!!!!!  :-[
10  Forum 2005-2010 (read only) / Interfacing / Re: Diecimila not reading well Serial data from PC on: December 01, 2007, 01:02:25 am
OK i solve it, i use this tutorial http://www.arduino.cc/en/Main/StandaloneAssembly, i took a 74ls04, and connect it between Arduino and the serial port and now everything works fines. Thanks!!! ;D
11  Forum 2005-2010 (read only) / Interfacing / Re: Diecimila not reading well Serial data from PC on: November 30, 2007, 08:22:52 pm
Thats was i tought (i read about a ttl voltage level), so i tried to put a resistance of 220 ohm to ground and RX pin, but not work. smiley-razz .
What i can do to solve this???  Convert R232 to arduino serial??? My arduino is working fine... is not burned... Thanks!!!
12  Forum 2005-2010 (read only) / Interfacing / Diecimila not reading well Serial data from PC on: November 30, 2007, 12:13:05 am
Hello,
Im trying to read some strings (ASCII) coming for the port (Com1, r232) of my computer with arduino, to be more exactly NMEA183. The data is generated by GPS Simul http://www.sailsoft.nl/gpssimul.htm, this app  simulate NMEA strings and send it trough any serial port you wish. GPS Simul settings are: Baudrate 4800, 8 databits, 1 stopbits, no parity.

First I connected PIN 3 of the serial PC to pin 1 of Arduino (RX), and Pin 5 of serial cable to Arduino ground.

I made several test, to be sure that the GPS Simul its working property, I made a virtual connection between Arduino Console and GPS Simul and I received the strings correctly, no problems, I even try another  GPS simulator software (trial versions) and the same results smiley.
The strings suppose to be like this:

$GPGGA,065248,2840.1036,N,10605.6417,W,1,5,1.0,2000.0,M,0,M,,,,0000*79
$GPGSA,A,3,01,02,03,04,05,,,,,,,,8.3,4.2,7.2*3B
$GPRMC,065248,A,2840.1036,N,10605.6417,W,33,46,281107,,,A*6C


But when I trying to read it with Arduino Hardware using this example (gps) http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1166042147/, I obtain this:

yåë•q_SWq§???£?§W§???£?§e§???£?§c§???£?§i«??åë•q_Kw}§??????§??§??§????§??«?}åë•q
_qq}§??????§????£????§c§?????£????§Q§?§??§?£?§?§e§??£?§e§§«?uåë•q_qY}§}§?§??§??§
??§§??§§??§§??§§??§??§?£?§?£?§?£?«??åë

I made all kind of test and the same, including this http://www.arduino.cc/playground/Tutorials/GPS, I even tried a code to obtain only the RAW data , and appears the same… Even try with another ports of Arduino (SPI) (Serial Library) and nothing….
And if you look to the LEDS of Arduino appears to be reading, and is “showing” results but something is wrong.
This is the code to obtain the raw data:

Code:
char incomingByte;

 void setup() {
   pinMode(13, OUTPUT);       // Initialize LED pin
   Serial.begin(4800);
   Serial.println("OK"); //Test OK
 }

 void loop() {
   digitalWrite(13, HIGH);//Led
 
 if (Serial.available() > 0) {
            
            incomingByte = Serial.read();
            Serial.print(incomingByte, BYTE);
      }
 }
By the way my Serial Port is working, and I used “char buffer[]; “ too, and nothing. :-[
13  Forum 2005-2010 (read only) / Español / Ejemplo de como leer datos seriales con Labview on: December 04, 2007, 10:46:29 pm
Bueno hice un pequeño ejemplo de cómo enviar y recibir cadenas de datos con Labview, para aquellos que lo utilizan y lo saben programar muy bien, pueden hacer maravillas utilizando Labview/Arduino y no tener que gastar mucho dinero en el hardware de national intruments. Suerte!!

Solo necesitan bajar el código fuente de labview 8.0 en:
http://jordii07.googlepages.com/arduinolabview.rar

Recuerda que puedes convertir cadenas de datos a decimales, hexadecimal, o en lo que necesites y conectarlo algún medidor visual bonito, o cualquier cosa que se te ocurra, el único limite es tu cabeza.
 smiley-wink

Por lo pronto estoy por terminar mi sistema para leer datos GPS generados y simulados por el Flight Simulator 2004, en cadenas NMEA (por el puerto serial) mismo que lee el arduino traduce  y luego controla un Joystick que utiliza señales PMM igual que los de radio control, que está conectado a la PC, y  controlan el avión en Fs2004. Esto con la finalidad de hacer prototipos de pilotos automáticos, que utilizare posteriormente en mi Arducopter, que como voy va a terminar siendo ArduPlane.
14  Forum 2005-2010 (read only) / Español / Re: Emulador de arduino por software on: November 23, 2007, 06:22:05 pm
SI hay un emulador, incluso puedes programar microcontroladores (sencillos), probar leds, resistencias, capacitores y como responderian, es de lo mejores que hay (tiene una base de datos de 16mil componentes), tambien puedes controlar pantallas LCD, pad numericos. EL problema es que es de paga, pero si solo lo vas a utilizar para aprender, te puedo ayudar a conseguirlo. Su nombre es multisim workbench, este programa pertenece a una empresa llamada national instruments, y tiene otro programa muy interesante llamado Labview, el cual es un sistema de programacion por entorno visual... Que puedes utilizarlo con arduino y tomar lectura con medidores sofiticados. Puedes adquirir un licencia de estudiante no por mucho.

http://www.electronicsworkbench.com/

Yo lo utilice secretamente en la universidad, me dejaron un proyecto de hacer un convertidor de binarios a decimales, hexadecimales  octagonal (de 4 bits de entrada) representado en un Display de 7 segmetos, todo con puertas logicas, and, or, not, xor (y nada de convertidor BCD 74ls246). Con este programa, y utilizando los componentes virtuales lo puede simular primero antes de hacerlo y luego lo pase a protoboards, (quedaron 6 en linea), fui el unico alumno en las ultimas 3 generaciones que lo entrego 100% funcional, porque era una bola de cables, y diagnosticar un problema utsss.. Por ahi tengo una foto mira:


Mi secreto fue multisim, de todos modos a casi todos aunque no funcionara les puso 10  :-/, Era nada mas para que supieramos como era la electronica digital en la edad de piedra y que todo eso lo puedes hacer con solo un componente....
15  Forum 2005-2010 (read only) / Español / Re: Usar Andruino desde Java directamente. on: December 20, 2007, 12:29:45 am
Te recomiendo que preguntes en la parte del foro que esta en ingles, aqui solo contestan por lo regular dudas basicas, muy muy basicas....
Si deseas programar arduino en lenguaje JAVA va estar dificil, pero puedes hacer que arduino se comunique mediante serial a programas javas e interactuen.
Mira ese chip FTDI se puso para facilitarle la vida a los de MAC y aparte darle energia arduino por el mismo cable USB, ya que tambien existe una version serial. Puedes  comunicarte a cualquier PC mediante Serial con el pin 0 y 1 (mismo que utiliza el FTDI para programar el atmega168), e interactuar con programas JAVA que puedar utilizar el puerto serial COMx.
Pages: [1] 2 3 ... 8