Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Interfacing / Re: LCD4Bit lib on: April 14, 2008, 02:13:33 pm
Hello guys. Im having troubbles using all LCD libraries i've found over there (Massimo's, Tomek's, playground's, the one from the previous posts, and some others I dont remember now)

The fact is that I make the wiring as the library needs to, but I cannot see anything when loading the examples into the arduino. I dont know why. I remember one day managed to write only at the first line of the LCD, and when I tried to start up the LCD with two lines, I got no letters readeable.

Could my problem be that, the examples I run, configured the LCD with 2.lines and I dont have enough power to write on them? I have LCD's Vcc input connected to 5v. from arduino.

Thanks in advance mates.
2  Forum 2005-2010 (read only) / Español / Es posible poner los analong inputs como outputs? on: April 17, 2008, 09:41:11 am
Hola de nuevo colegas! Pues eso, me gustaria saber si hay manera de usar los 6 pines "analog in" como salidas digitales, o que se comporten como digitales... Gracias!!
3  Forum 2005-2010 (read only) / Español / Re: Simulación de teclado on: April 15, 2008, 06:02:30 pm
Hola Vaul. Tu pregunta me es bastante intersante para mi proyecto (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1207672683). Quiero implementar dos ruletas que cuando giren, manden información al juego para así implementar un mando que modifique el reparto de frenada y otro para la mezcla de oxígeno y gasolina. La diferencia es que en vez de ser pulsadores conectados a pines digitales, son ruletas conectados a pines analógicos.

Puesto que estoy trabajando con un plugin (ejecutado por el juego) que se comunica con el arduino, se me ocurre que una forma de implementarlo es que cuando yo gire la ruleta, el arduino le mande el evento al plugin, y que éste notifique a la ventana del juego que se ha pulsado la tecla del teclado en la que, por ejemplo, está configurada la acción de incrementar la mezcla de oxígeno y gasolina. Es decir, engañando al juego, haciéndole creer que estoy pulsando una tecla del teclado. Esto creo que se puede programar con la librería windows.h, pero ya seria progamarlo dentro del plugin.

La verdad es que no tengo mucha idea, de momento no estoy en esta etapa del desarrollo, pero, mientras llego al problema, esta es mi idea, jeje.

Si consigues algo, intenta dejarlo escrito aquí aver si me ayuda.

Gracias.
4  Forum 2005-2010 (read only) / Exhibition / Cockpit for rFactor with Arduino on: April 08, 2008, 11:38:03 am
Hello girls & guys. It is my very first time here, and my very first ever electronic project, so greetings to all.

I'd like to show to all who enjoys racing sims (and the rest smiley-grin) how to build a home made cockpit data board for a racing simulator for PC. In this case i talk about rFactor which is a good simulator (The project could be usefull with other racing sims too. The sim might only have a plugin sending the same data in the same order to Arduino).

The project is now WIP. What it is done at the moment? Just Arduino controlling seven 7segments displays (3 for Speed + 1 for Gear + 3 for Fuel).

The system consists in one plugin for rFactor collecting info and sending each data as a byte (char). Each byte will be showed only in one display all the time, this one display is only for showing the hundred of the speed number (vg. 3 in 301 Km/h). Acorging to this, because of we have 7 displays, the plugin will be always sending 7 bytes data once per frame (3-bytes for Speed + 1-byte for Gear + 3-bytes for Fuel).

To control this amount of 7 segments displays, we would need 7-bits to control each display (7-bits x 7-displays = 49 outputs in arduino). Due to this, we need to make all of them sharing the same data bus (7-bits) to turn on/off each segment of the display. Then we would need to turn on only one display at a time, exactly the one that needs to show the digit sent through the 7-bits data bus. That means we need also some bits to select which display is showing what digit, that is 3-bits of selection that make us able to create 8 turns, allthough we only need 7 turns (one for each display).

As i told you, the project is still WIP, and i have planned to add a row of leds to show the revs of the engine, and an LCD display with a button to cyclicaly swap a lot of data, such as race position, lap time, tyres and oil and water temps, etc, etc.

I'll try to upload a video later on, if anyone is interested in the idea...

Thanks for reading.


Code:
unsigned int i = 0;    // Counter
unsigned int DB0 = 2;    // Controls G segment and DB0
unsigned int DB1 = 3;    // Controls F segment and DB1
unsigned int DB2 = 4;    // Controls A segment and DB2
unsigned int DB3 = 5;    // Controls B segment and DB3
unsigned int DB4 = 6;    // Controls E segment and DB4
unsigned int DB5 = 7;    // Controls D segment and DB5
unsigned int DB6 = 8;    // Controls C segment and DB6
unsigned int DB7 = 9;    // Controls DB7
unsigned int E = 10;   // Controls LCD's enable (S4 selection bit)
unsigned int A = 11;   // Controls S0 selection bit
unsigned int B = 12;   // Controls S1 selection bit
unsigned int C = 13;   // Controls S2 selection bit
unsigned digit = 0;
int display = 5;
int n_displays = 7;
char digitRecord[] = {'8','8','8','N','F','8','8'};      // Init

void setup()
{
  beginSerial(9600);
  for(i=2; i<=13; i++)
    pinMode(i, OUTPUT);
}

void loop()
{
      // If still remaining bytes on the serial port...
  if(serialAvailable() > 0)
  {
        // Reading the next available byte of the serial
    digitRecord[display] = serialRead();

        // Increment the display selector for the next reading
    display = (display +1) % n_displays;
  }
  
      // If theres no bytes available at the serial port, displays still showing their own digit.
  for(i=0; i<n_displays; i++)
  {
    if(i==4 && digitRecord[i]==' ')
      put7sgmnt(i,'F');
    else
      put7sgmnt(i, digitRecord[i]);
    if(i < n_displays - 1)
      delayMicroseconds(20);
  }

}

5  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Is it possible?   [about analog inputs] on: April 20, 2008, 05:00:25 am
Great, thanks a lot, and so easy. Thanks mates.  :smiley
6  Forum 2005-2010 (read only) / Frequently-Asked Questions / Is it possible?   [about analog inputs] on: April 18, 2008, 05:17:34 pm
Hello guys and girls. I have a question. Is it possible to use the analog inputs (ADC0~5) as digital outputs, or at least as analog outputs? If so... how? Thanks
Pages: [1]