hello, new with question SIK Experiment Guide for Arduino -

A place to hang out and chat with other like minded tinkerers

Moderators: phalanx, TS-Tim

Post Reply
kimbo
Posts: 2
Joined: Tue Oct 24, 2017 6:07 am

hello, new with question SIK Experiment Guide for Arduino -

Post by kimbo » Tue Oct 24, 2017 6:31 am

hi, i'm kimbo,
and i have commenced learning;
with reference to SIK Experiment Guide for Arduino - V3.3
Experiment 3: Driving an RGB LED

https://learn.sparkfun.com/tutorials/si ... an-rgb-led

my project gets the 8 colours ok -
but it doesn't do the rainbow gradient thing.

when i look at the code, in sketch(?), i can't understand if the rainbow gradient part is working or if it is something i need to paste into the section that is doing the 8 colours, replacing that section.

i wonder if perhaps the sketch(?) is not supposed to do both - 8 colors and rainbow gradient, but does one or the other.
i am embarrassed to ask this question - i suspect it is dumb:)
cheers,
Kim

darrellg
Posts: 318
Joined: Fri Oct 17, 2014 10:02 am
Location: Southern California

Re: hello, new with question SIK Experiment Guide for Arduin

Post by darrellg » Tue Oct 24, 2017 9:26 am

If you want to see the colors fade, you need to change

Code: Select all

void loop()
{
  mainColors();        // Red, Green, Blue, Yellow, Cyan, Purple, White
  //  showSpectrum();    // Gradual fade from Red to Green to Blue to Red
}
to

Code: Select all

void loop()
{
  mainColors();        // Red, Green, Blue, Yellow, Cyan, Purple, White
  showSpectrum();    // Gradual fade from Red to Green to Blue to Red
}
The two slashes before the call to showSpectrum() cause the compiler to skip that part. Two slashes indicate a comment, and everything after them to the end of the line is ignored.

kimbo
Posts: 2
Joined: Tue Oct 24, 2017 6:07 am

Re: hello, new with question SIK Experiment Guide for Arduin

Post by kimbo » Tue Oct 24, 2017 5:08 pm

thanks darrellg :)

Post Reply