Pages: 1 [2]
Author Topic: IN-17 Bulb CrossFade Code Example.  (Read 29995 times)
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 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


// 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
  digitalWrite(ledPin_a_2, HIGH);  
  digitalWrite(ledPin_a_2, LOW);

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

Pages: 1 [2]
Jump to: