Show Posts
Pages: [1]
1  Projects / ArduiNIX / I2C? on: March 27, 2014, 09:50:01 PM
I have been messing around with various I2C serial interface'd gizmos with Arduino, and it has occurred to me that V2 of the Arduinix board should have an I2C interface, to reduce the number of Ard pins that are required to drive the board. Have you considered this at all?

I would buy one ;^) .

cheers,

Dave.
2  Projects / ArduiNIX / tip on how to easily insert nixies into the boards on: November 29, 2011, 01:12:30 PM
I am in the process of building the 6-tube board, having already built the 4-tube one a few months ago. As you may know, it can be somewhat frustrating and time-consuming to get the nixie pin-wires inserted into the correct holes, even by using the plastic tube-base as a sort of template. I don't know if this has been suggested before, bu what I've started doing is

1) leave 4 adjacent wires at their original length -- I pick the ones at the "top" of the tube (it's pretty easy to get 4 wires in the board holes, then it gets more and more difficult, at least for me);
2) cut each of the remaining wires to a slightly shorter length than the one before, as I work around the tube.

i.e.,

1---------------------
2---------------------
3---------------------
4---------------------
5--------------------
6-------------------
7------------------
8-----------------
9----------------
10-------------
11------------

of course you have to be careful to not run out of wire length by the time you get to the last one!  But anyway after I've done that, getting the tube into the board becomes a 30 second effort rather than a 5 minute one, with less cussing too.

cheers,

Dave B.
3  Projects / ArduiNIX / Re: IN-17 Bulb CrossFade Code Example. on: June 17, 2011, 08:06:01 PM
Here is my code again but with some very slight tweaks - identical operation but with the  corrected fade value (I did end up using 0.3) and a few other cleanups that don't affect operation.



Code:
// fading transitions sketch for 4-tube board with default connections.
// based on 6-tube sketch by Emblazed
// 4-tube-itized by Dave Blevins 16 June 2011
// this shows minutes and seconds only

// SN74141 : Truth Table
//D C B A #
//L,L,L,L 0
//L,L,L,H 1
//L,L,H,L 2
//L,L,H,H 3
//L,H,L,L 4
//L,H,L,H 5
//L,H,H,L 6
//L,H,H,H 7
//H,L,L,L 8
//H,L,L,H 9

int ledPin_0_a = 2;               
int ledPin_0_b = 3;
int ledPin_0_c = 4;
int ledPin_0_d = 5;

int ledPin_1_a = 6;               
int ledPin_1_b = 7;
int ledPin_1_c = 8;
int ledPin_1_d = 9;

int ledPin_a_1 = 10;
int ledPin_a_2 = 11;
int ledPin_a_3 = 12;

void setup()
{
  pinMode(ledPin_0_a, OUTPUT);     
  pinMode(ledPin_0_b, OUTPUT);     
  pinMode(ledPin_0_c, OUTPUT);     
  pinMode(ledPin_0_d, OUTPUT);   
 
  pinMode(ledPin_1_a, OUTPUT);     
  pinMode(ledPin_1_b, OUTPUT);     
  pinMode(ledPin_1_c, OUTPUT);     
  pinMode(ledPin_1_d, OUTPUT);     
 
  pinMode(ledPin_a_1, OUTPUT);     
  pinMode(ledPin_a_2, OUTPUT);     
  pinMode(ledPin_a_3, OUTPUT);     
 
  // NOTE:
  // Grounding on virtual pins 14 and 15 (analog pins 0 and 1) will set the Hour and Mins.
  pinMode( 14, INPUT ); // set the vertual pin 14 (pin 0 on the analog inputs )
  digitalWrite(14, HIGH); // set pin 14 as a pull up resistor.

  pinMode( 15, INPUT ); // set the vertual pin 15 (pin 1 on the analog inputs )
  digitalWrite(15, HIGH); // set pin 15 as a pull up resistor.
 
}

void SetSN74141Chips( int num2, int num1 )
{
  int a,b,c,d;
 
  // set defaults.
  a=0;b=0;c=0;d=0; // will display a zero.
 
  // Load the a,b,c,d.. to send to the SN74141 IC (1)
  switch( num1 )
  {
    case 0: a=0;b=0;c=0;d=0;break;
    case 1: a=1;b=0;c=0;d=0;break;
    case 2: a=0;b=1;c=0;d=0;break;
    case 3: a=1;b=1;c=0;d=0;break;
    case 4: a=0;b=0;c=1;d=0;break;
    case 5: a=1;b=0;c=1;d=0;break;
    case 6: a=0;b=1;c=1;d=0;break;
    case 7: a=1;b=1;c=1;d=0;break;
    case 8: a=0;b=0;c=0;d=1;break;
    case 9: a=1;b=0;c=0;d=1;break;
    default: a=1;b=1;c=1;d=1;
    break;
  } 
 
  // Write to output pins.
  digitalWrite(ledPin_0_d, d);
  digitalWrite(ledPin_0_c, c);
  digitalWrite(ledPin_0_b, b);
  digitalWrite(ledPin_0_a, a);

  // Load the a,b,c,d.. to send to the SN74141 IC (2)
  switch( num2 )
  {
    case 0: a=0;b=0;c=0;d=0;break;
    case 1: a=1;b=0;c=0;d=0;break;
    case 2: a=0;b=1;c=0;d=0;break;
    case 3: a=1;b=1;c=0;d=0;break;
    case 4: a=0;b=0;c=1;d=0;break;
    case 5: a=1;b=0;c=1;d=0;break;
    case 6: a=0;b=1;c=1;d=0;break;
    case 7: a=1;b=1;c=1;d=0;break;
    case 8: a=0;b=0;c=0;d=1;break;
    case 9: a=1;b=0;c=0;d=1;break;
    default: a=1;b=1;c=1;d=1;
    break;
  }
 
  // Write to output pins
  digitalWrite(ledPin_1_d, d);
  digitalWrite(ledPin_1_c, c);
  digitalWrite(ledPin_1_b, b);
  digitalWrite(ledPin_1_a, a);
}

////////////////////////////////////////////////////////////////////////
//
// DisplayFadeNumberString
// Use: passing an array that is 4 elements long will display numbers
//      on a 4 nixie bulb setup.
//
////////////////////////////////////////////////////////////////////////
float fadeIn = 0.0;
float fadeOut = 8.0;
float fadeMax = 8.0;
float fadeStep = 0.3;  // tweak this to adjust speed of fade. Smaller number = slower fade
int NumberArray[4]={0,0,0,0};
int currNumberArray[4]={0,0,0,0};
float NumberArrayFadeInValue[4]={fadeIn,fadeIn,fadeIn,fadeIn};
float NumberArrayFadeOutValue[4]={fadeOut,fadeOut,fadeOut,fadeOut};

void DisplayFadeNumberString()
{
  // Nixie setup..
 
  // NOTE: If any of the bulbs need to blend then it will
  // be in time with the seconds bulbs. because any change only happens
  // on a one second interval.
 
  // 1 (0,3)
  SetSN74141Chips(currNumberArray[0],currNumberArray[3]);   
  digitalWrite(ledPin_a_1, HIGH);   
  delay(NumberArrayFadeOutValue[0]);
  SetSN74141Chips(NumberArray[0],NumberArray[3]);   
  delay(NumberArrayFadeInValue[0]);
  digitalWrite(ledPin_a_1, LOW);
 
  // 2 (1,2)
  SetSN74141Chips(currNumberArray[1],currNumberArray[2]);   
  digitalWrite(ledPin_a_2, HIGH);   
  delay(NumberArrayFadeOutValue[1]);
  SetSN74141Chips(NumberArray[1],NumberArray[2]);   
  delay(NumberArrayFadeInValue[1]);
  digitalWrite(ledPin_a_2, LOW);
 
  // Loop thru and update all the arrays, and fades.
  for( int i = 0 ; i < 4 ; i ++ )
  {
    if( NumberArray[i] != currNumberArray[i] )
    {
      NumberArrayFadeInValue[i] += fadeStep;
      NumberArrayFadeOutValue[i] -= fadeStep;
 
      if( NumberArrayFadeInValue[i] >= fadeMax )
      {
        NumberArrayFadeInValue[i] = 0.0f;
        NumberArrayFadeOutValue[i] = fadeMax;
        currNumberArray[i] = NumberArray[i];
      }
    }
  } 
}

// Defines
long MINS = 60;         // 60 Seconds in a Min.
long HOURS = 60 * MINS; // 60 Mins in an hour.
long DAYS = 24 * HOURS; // 24 Hours in a day. > Note: change the 24 to a 12 for non millitary time.

long runTime = 0;       // Time from when we started.

// default time sets. clock will start at 12:59:00
long clockHourSet = 12;
long clockMinSet  = 59;

int HourButtonPressed = false;
int MinButtonPressed = false;

////////////////////////////////////////////////////////////////////////
//
//
////////////////////////////////////////////////////////////////////////
void loop()     
{
  // Get milliseconds.
  runTime = millis();
 
  int hourInput = digitalRead(14); 
  int minInput  = digitalRead(15);

  if( hourInput == 0 )
    HourButtonPressed = true;
  if( minInput == 0 )
    MinButtonPressed = true;
 
  if( HourButtonPressed == true && hourInput == 1 )
  {
    clockHourSet++;
    HourButtonPressed = false;
  }
 
  if( MinButtonPressed == true && minInput == 1 )
  {
    clockMinSet++;
    MinButtonPressed = false;
  }

  // Get time in seconds.
  long time = (runTime) / 1000;
 
  // Set time based on offset..
  // long hbump = 60*60*clockHourSet;
  long hbump = 60*60*clockHourSet;
  long mbump = 60*clockMinSet;
  time += mbump + hbump;

  // Convert time to days,hours,mins,seconds
  long days  = time / DAYS;    time -= days  * DAYS;
  long hours = time / HOURS;   time -= hours * HOURS;
  long minutes  = time / MINS;    time -= minutes  * MINS;
  long seconds  = time;

  // Get the high and low order values for hours,min,seconds.
  int lowerHours = hours % 10;
  int upperHours = hours - lowerHours;
  int lowerMins = minutes % 10;
  int upperMins = minutes - lowerMins;
  int lowerSeconds = seconds % 10;
  int upperSeconds = seconds - lowerSeconds;
  if( upperSeconds >= 10 )   upperSeconds = upperSeconds / 10;
  if( upperMins >= 10 )      upperMins = upperMins / 10;
  if( upperHours >= 10 )     upperHours = upperHours / 10;

  // Fill in the Number array used to display on the tubes.
  NumberArray[3] = upperMins;
  NumberArray[2] = lowerMins;
  NumberArray[1] = upperSeconds;
  NumberArray[0] = lowerSeconds;

  // Display.
  DisplayFadeNumberString();
}
4  Projects / ArduiNIX / Re: IN-17 Bulb CrossFade Code Example. on: June 16, 2011, 04:06:36 PM
OK it turns out that the fade is working in my code, but I had used the same value of fadeStep (1.0) that Emblazed has in the code I started with, which makes for a too-fast fade with my board. Changing it to 0.4 gives a nice fade without overdoing it (0.3 is too much, or should I say too little).

I suspect that this value has to be tweaked depending on how hard you're driving your IN-17s; I have my anode voltage set to about 150V which is about as low as I can go before digits start fading a bit.

have fun,

Dave.
5  Projects / ArduiNIX / 6 tube boards? on: June 16, 2011, 02:50:13 PM
I'm wondering if you RobotPirates are still planning on releasing the 6 tube w/ colon dots boards that were discussed in a thread quite a while ago??

I might be interested in the 8-tube one as well...

thx,

Dave.
6  Projects / ArduiNIX / Re: IN-17 Bulb CrossFade Code Example. on: June 16, 2011, 02:37:43 PM
OK here's my code. To be honest I'm not sure if the x-fade thing is working; if it is it's subtle.

This displays minutes and seconds; it's left as an exercise to change it to hours:minutes.

(note: I have not verified the hours/minutes set button functionality yet.)

cheers,

Dave.

Code:
// fading transitions sketch for 4-tube board with default connections.
// based on 6-tube sketch by Emblazed
// 4-tube-itized by Dave B. 16 June 2011
// this shows minutes and seconds only

// SN74141 : Truth Table
//D C B A #
//L,L,L,L 0
//L,L,L,H 1
//L,L,H,L 2
//L,L,H,H 3
//L,H,L,L 4
//L,H,L,H 5
//L,H,H,L 6
//L,H,H,H 7
//H,L,L,L 8
//H,L,L,H 9

int ledPin_0_a = 2;               
int ledPin_0_b = 3;
int ledPin_0_c = 4;
int ledPin_0_d = 5;

int ledPin_1_a = 6;               
int ledPin_1_b = 7;
int ledPin_1_c = 8;
int ledPin_1_d = 9;

int ledPin_a_1 = 10;
int ledPin_a_2 = 11;
int ledPin_a_3 = 12;

void setup()
{
  pinMode(ledPin_0_a, OUTPUT);     
  pinMode(ledPin_0_b, OUTPUT);     
  pinMode(ledPin_0_c, OUTPUT);     
  pinMode(ledPin_0_d, OUTPUT);   
 
  pinMode(ledPin_1_a, OUTPUT);     
  pinMode(ledPin_1_b, OUTPUT);     
  pinMode(ledPin_1_c, OUTPUT);     
  pinMode(ledPin_1_d, OUTPUT);     
 
  pinMode(ledPin_a_1, OUTPUT);     
  pinMode(ledPin_a_2, OUTPUT);     
  pinMode(ledPin_a_3, OUTPUT);     
 
  // NOTE:
  // Grounding on virtual pins 14 and 15 (analog pins 0 and 1) will set the Hour and Mins.
  pinMode( 14, INPUT ); // set the vertual pin 14 (pin 0 on the analog inputs )
  digitalWrite(14, HIGH); // set pin 14 as a pull up resistor.

  pinMode( 15, INPUT ); // set the vertual pin 15 (pin 1 on the analog inputs )
  digitalWrite(15, HIGH); // set pin 15 as a pull up resistor.
 
}

void SetSN74141Chips( int num2, int num1 )
{
  int a,b,c,d;
 
  // set defaults.
  a=0;b=0;c=0;d=0; // will display a zero.
 
  // Load the a,b,c,d.. to send to the SN74141 IC (1)
  switch( num1 )
  {
    case 0: a=0;b=0;c=0;d=0;break;
    case 1: a=1;b=0;c=0;d=0;break;
    case 2: a=0;b=1;c=0;d=0;break;
    case 3: a=1;b=1;c=0;d=0;break;
    case 4: a=0;b=0;c=1;d=0;break;
    case 5: a=1;b=0;c=1;d=0;break;
    case 6: a=0;b=1;c=1;d=0;break;
    case 7: a=1;b=1;c=1;d=0;break;
    case 8: a=0;b=0;c=0;d=1;break;
    case 9: a=1;b=0;c=0;d=1;break;
    default: a=1;b=1;c=1;d=1;
    break;
  } 
 
  // Write to output pins.
  digitalWrite(ledPin_0_d, d);
  digitalWrite(ledPin_0_c, c);
  digitalWrite(ledPin_0_b, b);
  digitalWrite(ledPin_0_a, a);

  // Load the a,b,c,d.. to send to the SN74141 IC (2)
  switch( num2 )
  {
    case 0: a=0;b=0;c=0;d=0;break;
    case 1: a=1;b=0;c=0;d=0;break;
    case 2: a=0;b=1;c=0;d=0;break;
    case 3: a=1;b=1;c=0;d=0;break;
    case 4: a=0;b=0;c=1;d=0;break;
    case 5: a=1;b=0;c=1;d=0;break;
    case 6: a=0;b=1;c=1;d=0;break;
    case 7: a=1;b=1;c=1;d=0;break;
    case 8: a=0;b=0;c=0;d=1;break;
    case 9: a=1;b=0;c=0;d=1;break;
    default: a=1;b=1;c=1;d=1;
    break;
  }
 
  // Write to output pins
  digitalWrite(ledPin_1_d, d);
  digitalWrite(ledPin_1_c, c);
  digitalWrite(ledPin_1_b, b);
  digitalWrite(ledPin_1_a, a);
}

////////////////////////////////////////////////////////////////////////
//
// DisplayNumberString
// Use: passing an array that is 4 elements long will display numbers
//      on a 4 nixie bulb setup.
//
////////////////////////////////////////////////////////////////////////
float fadeIn = 0.0f;
float fadeOut = 8.0f;
float fadeMax = 8.0f;
float fadeStep = 1.0f;
int NumberArray[4]={0,0,0,0};
int currNumberArray[4]={0,0,0,0};
float NumberArrayFadeInValue[4]={0.0f,0.0f,0.0f,0.0f};
float NumberArrayFadeOutValue[4]={8.0f,8.0f,8.0f,8.0f};

void DisplayFadeNumberString()
{
  // Nixie setup..
 
  // NOTE: If any of the bulbs need to blend then it will
  // be in time with the seconds bulbs. because any change only happens
  // on a one second interval.
 
  // 1 (0,3)
  SetSN74141Chips(currNumberArray[0],currNumberArray[3]);   
  digitalWrite(ledPin_a_1, HIGH);   
  delay(NumberArrayFadeOutValue[0]);
  SetSN74141Chips(NumberArray[0],NumberArray[3]);   
  delay(NumberArrayFadeInValue[0]);
  digitalWrite(ledPin_a_1, LOW);
 
  // 2 (1,2)
  SetSN74141Chips(currNumberArray[1],currNumberArray[2]);   
  digitalWrite(ledPin_a_2, HIGH);   
  delay(NumberArrayFadeOutValue[1]);
  SetSN74141Chips(NumberArray[1],NumberArray[2]);   
  delay(NumberArrayFadeInValue[1]);
  digitalWrite(ledPin_a_2, LOW);
 
  // Loop thru and update all the arrays, and fades.
  for( int i = 0 ; i < 4 ; i ++ )
  {
    if( NumberArray[i] != currNumberArray[i] )
    {
      NumberArrayFadeInValue[i] += fadeStep;
      NumberArrayFadeOutValue[i] -= fadeStep;
 
      if( NumberArrayFadeInValue[i] >= fadeMax )
      {
        NumberArrayFadeInValue[i] = 0.0f;
        NumberArrayFadeOutValue[i] = fadeMax;
        currNumberArray[i] = NumberArray[i];
      }
    }
  } 
}

// Defines
long MINS = 60;         // 60 Seconds in a Min.
long HOURS = 60 * MINS; // 60 Mins in an hour.
long DAYS = 24 * HOURS; // 24 Hours in a day. > Note: change the 24 to a 12 for non millitary time.

long runTime = 0;       // Time from when we started.

// default time sets. clock will start at 12:59:00
long clockHourSet = 12;
long clockMinSet  = 59;

int HourButtonPressed = false;
int MinButtonPressed = false;

////////////////////////////////////////////////////////////////////////
//
//
////////////////////////////////////////////////////////////////////////
void loop()     
{
  // Get milliseconds.
  runTime = millis();
 
  int hourInput = digitalRead(14); 
  int minInput  = digitalRead(15);

  if( hourInput == 0 )
    HourButtonPressed = true;
  if( minInput == 0 )
    MinButtonPressed = true;
 
  if( HourButtonPressed == true && hourInput == 1 )
  {
    clockHourSet++;
    HourButtonPressed = false;
  }
 
  if( MinButtonPressed == true && minInput == 1 )
  {
    clockMinSet++;
    MinButtonPressed = false;
  }

  // Get time in seconds.
  long time = (runTime) / 1000;
 
  // Set time based on offset..
  // long hbump = 60*60*clockHourSet;
  long hbump = 60*60*clockHourSet;
  long mbump = 60*clockMinSet;
  time += mbump + hbump;

  // Convert time to days,hours,mins,seconds
  long days  = time / DAYS;    time -= days  * DAYS;
  long hours = time / HOURS;   time -= hours * HOURS;
  long minutes  = time / MINS;    time -= minutes  * MINS;
  long seconds  = time;

  // Get the high and low order values for hours,min,seconds.
  int lowerHours = hours % 10;
  int upperHours = hours - lowerHours;
  int lowerMins = minutes % 10;
  int upperMins = minutes - lowerMins;
  int lowerSeconds = seconds % 10;
  int upperSeconds = seconds - lowerSeconds;
  if( upperSeconds >= 10 )   upperSeconds = upperSeconds / 10;
  if( upperMins >= 10 )      upperMins = upperMins / 10;
  if( upperHours >= 10 )     upperHours = upperHours / 10;

  // Fill in the Number array used to display on the tubes.
  NumberArray[3] = upperMins;
  NumberArray[2] = lowerMins;
  NumberArray[1] = upperSeconds;
  NumberArray[0] = lowerSeconds;

  // Display.
  DisplayFadeNumberString();
}
7  Projects / ArduiNIX / Re: IN-17 Bulb CrossFade Code Example. on: June 16, 2011, 01:28:22 PM
The example fader sketch is for a 6-tube setup. Also, for whatever reason the pin declarations are different than the example 4-tube sketch provided in another thread that works for me. So I had to change the 0 through 10 pin numbers to 2 through 12 as noted by another post.

But the bigger problem is that the rest of the code is intended for 6 tubes, and quite a lot has to be modified to get it to work with a 4 tube setup. I have it working at least in terms of counting at the moment, but somehow I have managed to break the fading effect which is the whole point of the sketch!

I'll hopefully get it working and will report back with the modified source.

Dave B.
San Jose, CA
Pages: [1]