Pages: 1 [2]
Author Topic: IN-17 Bulb CrossFade Code Example.  (Read 29995 times)
Wingloader
Newbie
*
Posts: 1


Flying at Quest Air


View Profile Email
« Reply #15 on: March 13, 2015, 09:41:36 PM »

Hi everyone!!  

FYI, I did search the forum and I didn't see anyone talk about this one...

I am using the code from http://www.arduinix.com/Main/Downloads.htm for the 6 tube crossfade.  There is something that doesn't make sense for me.  I'm trying to learn how this actually works.

Here is the problem:

1)  ledPin_a_1 is defined as pin 10 and initialized as OUTPUT but is never referenced anywhere else in the code.
2)  ledPin_a_4 is defined as pin 13 but is NOT initialized as OUTPUT but it is used in the DisplayFadeNumberString function.
3)  in the DisplayFadeNumberString, ledPin_a_4 IS used even though ledPin_a_4 is never initialized as an OUTPUT.  
4)  if this is a 6 tube clock code, why do we need 4 anodes?

code snippets below

Thanks!
Joe

Code:
// anode pins
int ledPin_a_1 = 10;
int ledPin_a_2 = 11;
int ledPin_a_3 = 12;
int ledPin_a_4 = 13;

In setup:
 pinMode(ledPin_a_1, OUTPUT);      
  pinMode(ledPin_a_2, OUTPUT);      
  pinMode(ledPin_a_3, OUTPUT);  



void DisplayFadeNumberString()
{
 
  // Anode channel 1 - numerals 0,3
  SetSN74141Chips(currNumberArray[0],currNumberArray[3]);  
  digitalWrite(ledPin_a_2, HIGH);  
  delay(NumberArrayFadeOutValue[0]);
  SetSN74141Chips(NumberArray[0],NumberArray[3]);  
  delay(NumberArrayFadeInValue[0]);
  digitalWrite(ledPin_a_2, LOW);

  // Anode channel 2 - numerals 1,4
  SetSN74141Chips(currNumberArray[1],currNumberArray[4]);  
  digitalWrite(ledPin_a_3, HIGH);  
  delay(NumberArrayFadeOutValue[1]);
  SetSN74141Chips(NumberArray[1],NumberArray[4]);  
  delay(NumberArrayFadeInValue[1]);
  digitalWrite(ledPin_a_3, LOW);
  
   // Anode channel 3 - numerals 2,5
  SetSN74141Chips(currNumberArray[2],currNumberArray[5]);  
  digitalWrite(ledPin_a_4, HIGH);  
  delay(NumberArrayFadeOutValue[2]);
  SetSN74141Chips(NumberArray[2],NumberArray[5]);  
  delay(NumberArrayFadeInValue[2]);
  digitalWrite(ledPin_a_4, LOW);
  
« Last Edit: March 13, 2015, 09:44:17 PM by Wingloader » Logged

Pages: 1 [2]
Print
Jump to: