Show Posts
Pages: 1 ... 85 86 [87] 88 89 ... 110
1291  Forum 2005-2010 (read only) / Exhibition / Re: FORTH environment for Arduino on: January 01, 2011, 11:17:24 am
Neat.

Peanut Gallery Comment:  Forth never really caught on... did it.
1292  Forum 2005-2010 (read only) / Exhibition / Re: audiophile 3-way active crossover *volume control* on: January 01, 2011, 08:59:57 pm
As always... Excellent work.
1293  Forum 2005-2010 (read only) / Exhibition / Re: dip swit basic need help led on: December 28, 2010, 08:31:34 pm
FYI: "Exhibition" is about showing off what you have done.

If you are a noob and want to learn more, there are some really good documents and even books available.  Nothing says you can't just "read" for a while before you start experimenting.

Good places to start:

http://www.lulu.com/items/volume_63/1108000/1108699/4/print/ARDUINO_NOTEBOOKv6.pdf


http://dave.lab6.com/acid/dump/2009/ASKManual.pdf
1294  Forum 2005-2010 (read only) / Exhibition / Re: Live For Speed Gear Indicator on: December 23, 2010, 04:24:41 pm
A lot of the real work was done in the UDP-INSIM-PACKET application on the PC.  It listens to the OUTGAUGE values from the network and creates the serial commands that are sent to the arduino.

While this was an attempt to recreate the Gear Indicator project, it could certainly be expanded to control other things... like a real world Speedo and real gauges.  Having all the source code makes it just a simple matter of coding.

Not having to use overly complicated C# or JAVA means I can code something up even if I'm short on time.


While I am  certainly still tweaking the UDP-Serial application, I have made it available in its current state on my website.  

http://www.pwillard.com/files/OGBFINAL.zip
1295  Forum 2005-2010 (read only) / Exhibition / Live For Speed Gear Indicator on: December 22, 2010, 02:32:01 pm
Work IN progress...

What is it?

The Racing Simulator "Live For Speed" has the ability to broadcast live simulation data over UDP packets for much of the in-game data so even remote devices can make use of data available.  This data is defined as the INSIM PACKET data.  Among these is the OUTGAUGE (dashboard) information such as speed, Turbo Boost, RPM, Current Gear, etc.

A while back, a determined hacker named Vladimir Kadlec created a way to display the GEAR INDICATOR data to a seven segment LED attached to the LPT port.

This was all good while we still had LPT ports, but we seem to no longer get LPT ports on our systems.  I started a project that would convert the OUTGAUGE UDP - to- LPT  project into a OUTGAUGE UDP -to- Serial Port project by removing the LPT code and replacing it with the Serial Port using the Windows API.

Vlad's Project was great.  It was written in the very "free" DevC++ Windows C Compiler and all source code was available.  Adding the Windows Serial API was pretty straightforward.  

So, I coded up a USB-FTDI-Serial port µController.

http://www.pwillard.com/files/gearind.pdf



After looking over some available tutorials... I decided to use them as a launching point for an old project I started that originally used the now obsolete Parallax SX28.   I decided to share my progress.

Arduino Code - Complete (below)
INSIM UDP to Serial Relay client - Complete (will be posted on my website)
Enclosure - In Progress

Test Setup:


Code:
//----[ OutGaugeBus ]------------------------------------------------------
//  Name    : OGBUS.PDE
//-------------------------------------------------------------------------
//  Purpose : Receive serial commmands from "Live For Speed" INSIM OUTGAUGE
//          : Client and then display real-time dashboard information
//          : on Arduino based output devices, such as LED's.
//          : Live For Speed References:
//          : LFS/DOCS/INSIM.TXT
//          : http://en.lfsmanual.net/wiki/InSim_Tutorials
//          : http://www.brunsware.de/insim/
//          : See Also: http://www.lfs.net/
//-------------------------------------------------------------------------
//  Date    : 25 Oct, 2007 ( Started as a Parallax SX28 project )
//  Version : 2.11
//  Modified: 12/22/2010 11:30:34 AM
//  Author  : Pete Willard
//          :
//Additional:
//  Credits : * Mike McRoberts - Earthshine Design -
//          :     Arduino Starter Kit PDF
//          :
//          : * Hacktronics - http://www.hacktronics.com/Tutorials
//          :
//          : * Arduino ShiftOut tutorial
//          :
//          : To keep code "recognizable", available references were used
//          : and changed very little from reference sources listed above.
//-------------------------------------------------------------------------
//  Notes   : Includes using a 74HC595 Shift Register for the Bar Graph
//          : and discrete 7-segment display for gear indicator
//          :
//          : Commands come from OGBUS.EXE (DevC++ UDP Client) and convert
//          : INSIM OUTGAUGE data into serial packet data for Arduino
//          : INSIM Client Software will send ALL vaalues every update
//          : but can send as little as Clear Command "C0"
//          :
//          : Expansion:
//          : With a little creative wiring, it would be possible to
//          : daisy chain multiple serial Arduino boards or if USB is
//          : used, multiple OGBUS clients can be run at one time
//          :
//          : Command Examples:
//          : (Comma Separated Values) Any Order up to 24 Characters
//          : Format: <command><argument>,<command><argument>...<cr><lf>
//          : C0    = Clear All Outputs
//          : G0-G8 = Gear Indicator
//          : R0-R8 = RPM Bargraph
//          : S0|S1 = Shift Light Pin On|Off (binary)
//          : P0|P1 = Pit Limiter Pin On|Off (binary)
//          :
//-------------------------------------------------------------------------


//----[ Variables ]--------------------------------------------------------
const int buffsize = 25;     // Buffer Size
char buffer[buffsize];      // Incoming Serial Data Buffer
int  debug    = 0;          // Set to NON-ZERO to test with Serial Monitor
int  ledCount = 8;          // The number of LEDs in the Bar Graph LED
//-------------------------------------------------------------------------
// Seven segment LED layout for the Gear Indicator
// Arduino pins must be sequential
int GIstartpin = 2;
//                    Arduino pin: 2,3,4,5,6,7,8
byte seven_seg_digits[9][7] = {  { 0,0,0,0,1,0,1 },  // = R
                                 { 0,0,1,0,1,0,1 },  // = N
                                 { 0,1,1,0,0,0,0 },  // = 1
                                 { 1,1,0,1,1,0,1 },  // = 2
                                 { 1,1,1,1,0,0,1 },  // = 3
                                 { 0,1,1,0,0,1,1 },  // = 4
                                 { 1,0,1,1,0,1,1 },  // = 5
                                 { 1,0,1,1,1,1,1 },  // = 6
                                 { 0,0,0,0,0,0,0 },  // = 7 (blank)
                                                 };
//                                 a b c d e f g ------>  LED segment
//-------------------------------------------------------------------------
// Bargraph Values for 8 LED Bargraph
// Only 8 values of BYTE are needed to light the 8 bargraph LED's
// sequentially
// NOTE: Most Bargraph LED's are "10 unit" so I have bottom 2 and top 2
// LED's tied together.
// Part Number used:   AVAGO "HDSP-4832"  3-Green 4-Yellow 3-Red
// Mouser Part Number: 630-HDSP-4832
// The Shift Register lowest outputs start with Green Anodes of the
// Bargraph.
//
byte bargraph[9] = {0x00,0x01,0x03,0x07,0x0F,0x1F,0x3F,0x7F,0xFF};
//-------------------------------------------------------------------------
// LED PINS - optional since we are low on pins
int shiftlight = 12;
//int pitlimit   = 13;     // Pick one
//int lowfuel    = 13;
//-------------------------------------------------------------------------
// 74HC595 Pin Setup
int latchPin = 9;   // Pin connected to ST_CP (12) of 74HC595
int clockPin = 10;  // Pin connected to SH_CP (11) of 74HC595
int dataPin  = 11;  // Pin connected to DS    (14) of 74HC595

//----[ SETUP ]-----------------------------------------------------------
void setup() {
  // Speed needs to match INSIM - Outgauge Client Configuration setting
  Serial.begin(19200);
  Serial.flush();

  // Set all pins to Outut Mode
  int a;
  for(a=0;a < 13;a++){
      pinMode(a, OUTPUT);
   }
}

//----[ MAIN LOOP ]------------------------------------------------------
void loop() {

// Mike McRoberts serial input command routines
// from the "Serial Controlled Mood Lamp" example
// in Arduino Starter Kit Manual from Earthshine Design

if (Serial.available() > 0) {
int index=0;
  delay(10); // let the buffer fill up
  int numChar = Serial.available();
   if (numChar>buffsize) {
       numChar=buffsize;
      }
   while (numChar--) {
          buffer[index++] = Serial.read();
         }
 splitString(buffer); // Process Serial Packet
 }
}

//----[ SubRoutines ]----------------------------------------------------

void splitString(char* data) {
// also from "Serial Controlled Mood Lamp" example

if (debug) {
 Serial.print("Data entered: ");
 Serial.println(data);
}

// Sequentially De-Tokenize the Serial Commands received
 char* parameter;
       parameter = strtok (data, " ,");
   while (parameter != NULL) {
          // Pass result to parseCMD for each Command received
          parseCMD(parameter);
          // remove processed commands from the list
          parameter = strtok (NULL, " ,");
   }

   // Clear the text and serial buffers
   for (int x=0; x<buffsize; x++) {
        buffer[x]='\0';
   }
  Serial.flush();
}

//=======================================================================
void parseCMD(char* data) {
// Flexible, easily expanded Command Parser
// based on "Serial Controlled Mood Lamp" example
// *** Marvelous coding by Mike MCRoberts

//--[gear]---------------------------------------
if ((data[0] == 'G') || (data[0] == 'g')) {
 // Have command, now get Argument "value" while removing whitespace
 int ArgVal = strtol(data+1, NULL, 10);
 // then limit the results to what we expect for this command
     ArgVal = constrain(ArgVal,0,8);
     sevenSegWrite(ArgVal);

     if (debug) {
         Serial.print("Gear is set to: ");
         Serial.println(ArgVal);
     }
}

//--[shift light]--------------------------------
if ((data[0] == 'S') || (data[0] == 's')) {
 int ArgVal = strtol(data+1, NULL, 10);
     ArgVal = constrain(ArgVal,0,1);
     digitalWrite(shiftlight,ArgVal);

     if (debug) {
         Serial.print("SHIFT is set to: ");
         Serial.println(ArgVal);
     }
}

//--[reset]--------------------------------------
 if ((data[0] == 'C') || (data[0] == 'c')) {
   int ArgVal = strtol(data+1, NULL, 10);
       ArgVal = constrain(ArgVal,0,1);

       sevenSegWrite(8);
       shiftWrite(0x00);

     if (debug) {
         Serial.print("Clear Outputs");
     }
 }

 //--[rpm bar graph]-----------------------------
 if ((data[0] == 'R') || (data[0] == 'r')) {
   int ArgVal = strtol(data+1, NULL, 10);
       ArgVal = constrain(ArgVal,0,8);

       shiftWrite(bargraph[ArgVal]);

       if (debug) {
           Serial.print("RPM is set to: ");
           Serial.println(ArgVal);
       }
 }

} // End parseCMD Loop


//=======================================================================
void sevenSegWrite(byte digit) {
  byte pin = GIstartpin;
  for (byte segCount = 0; segCount < 7; ++segCount) {
    digitalWrite(pin, seven_seg_digits[digit][segCount]);
    ++pin;
  }
 }
//=======================================================================
void shiftWrite(byte Rdata){
    // prepare the register for data
    digitalWrite(latchPin, LOW);
    // shift out the bits:
    shiftOut(dataPin, clockPin, MSBFIRST, Rdata);
    //Set the latch pin high to enable the outputs
    digitalWrite(latchPin, HIGH);
}

1296  Forum 2005-2010 (read only) / Exhibition / Re: Fake Moon (lunar eclipse simulator) on: December 22, 2010, 07:36:00 pm
I got to see it too... a few times...   Much fun.   This is an awesome project for moon-lovers.

FYI:  My PC is named "blackmoon" on the home LAN.  Has been for eons.  smiley-wink
1297  Forum 2005-2010 (read only) / Exhibition / Re: lightning detector on: March 05, 2010, 05:55:14 pm
It's not really designed to prevent a full strike from reaching the house...  but it does have a more direct path to earth ground than leaping through the opto.   Most real world lightning protection for underground wiring is designed with sacrificial parts.

This is a nicely modified version of what Tim Bitson and others use to count strikes.
1298  Forum 2005-2010 (read only) / Exhibition / Re: Connecting real car cluster with pc games (X-sim)2 on: October 17, 2010, 07:45:23 pm
Dang... purdy!!!!
1299  Forum 2005-2010 (read only) / Exhibition / Re: Typ K Thermocouple to RGB LED on: February 19, 2010, 07:16:56 pm
Yeah, this one is for a Laminator heater sensor.   The next one I do is for a 2000 degree Kiln... using  the "other" MAXIM thermocouple IC.
1300  Forum 2005-2010 (read only) / Exhibition / Re: Typ K Thermocouple to RGB LED on: February 19, 2010, 02:08:52 pm
Cool Stuff... I just started playing with the type K thermocouples myself and created this break out board last night.

1301  Forum 2005-2010 (read only) / Exhibition / Re: Toner Transfer - My First Shield on: July 20, 2010, 09:23:09 pm
Yes, and it works quite well.
1302  Forum 2005-2010 (read only) / Exhibition / Re: macetech and Arduino in Twilight Eclipse on: July 01, 2010, 09:02:52 am
This is great stuff!  Creating movie props is such an ideal application for small controllers.
1303  Forum 2005-2010 (read only) / Exhibition / Re: Mr.Tidy (Mega Version), Autonomous colour gripper on: June 27, 2010, 08:29:23 am
The intelligence of the color sensing and the smarts behind using the gripper arm for stacking must have been fun challenges.

I particularly liked the randomness of the hunting/avoidance routines that avoided getting stuck in a loop by taking into account... boredom.  
1304  Forum 2005-2010 (read only) / Exhibition / Re: Mr.Tidy (Mega Version) - visits the Swiss Alps !!! on: June 26, 2010, 06:44:21 pm
Awesome.  Nicely Done.
1305  Forum 2005-2010 (read only) / Exhibition / Re: Commodore 64 scrolling text messages on: April 28, 2010, 06:00:32 am
Neat.  I like it.
Pages: 1 ... 85 86 [87] 88 89 ... 110