Assuming everything is hooked up right that should work. All the sequence one code does is light each led in sequence from 0-15 and then back down. Kinda a wave pattern.
The one thing you might need to check is that the address is correct
const byte SX1509_ADDRESS = 0x3E; // SX1509 I2C address
It's also possible you are never getting past this
Code: Select allif (!io.begin(SX1509_ADDRESS)){
while (1) ; // If we fail to communicate, loop forever for now but lets warn the user somehow
}
which initializes the sx1509 and waits for it to say it is ok. If the board never says it is ok then it will never go any farther in the code.
Some code explanation:
int seq_1_current = 0; // current led in sequence 1
const int num_led = 15; // total number of leds in bar graph
in the loop:
currentMillis variable holds the current clock time from the arduino.
Every time it loops it calls the main bar graph sequence
prevBarMillis_on keeps track of the last time we turned on or off an led
pwrcl_interval is the speed at which we are turning leds on or off. In this case 60 milliseconds
reverseSequenceOne keeps track of if the bar graph lighting the leds or shutting them down.
Code: Select allif (currentMillis - prevBarMillis_on > pwrcl_interval) {
so here we're saying If the current time minus the last time we lit an LED is greater than the LED lighting interval then continue into the function
we save out the current time as we are about to change an led in some way
Code: Select allif( reverseSequenceOne == false ){
if we are doing the lighting animation
Code: Select all // first we take the current light we are dealing with and turn it on
switch_graph_led(seq_1_current, HIGH);
// then increment the count so the next time we come around that light will light
seq_1_current++;
// but we check to see if we are at the end of the led's we have or not. If we are then let's set
// the function to reverse on the next time it comes through and start turning led's off.
if( seq_1_current > num_led ) {
reverseSequenceOne = true;
}
switch_graph_led function: This is a helper function that takes an LED number and an on/off state and sets the light specified to that state.
My guess is that the arduino is not talking to the sx1509 for some reason. It might be a good idea to try out this sample before continuing.
https://learn.sparkfun.com/tutorials/sx ... ed-driving Some more progress tonight. I have most of the parts glued on and more sanding done. I'm close to the point where I will give the filler primer a try again. This time a lot lighter on the coats that is for sure.