formatting improvements to RGB example

White space-only changes to fix indentation and general consistency withing example
This commit is contained in:
Nathan Friedly 2016-03-29 10:59:10 -04:00
parent 41c25785db
commit f402493d27

View File

@ -18,36 +18,29 @@ void setup() {
}
void loop ()
{
void loop() {
//direction: up = true, down = false
boolean dir = true;
int i = 0;
while(1)
{
while(1) {
fade(COLORS[i%3], dir);
i++;
dir = !dir;
}
}
void fade(byte Led, boolean dir)
{
void fade(byte Led, boolean dir) {
int i;
//if fading up
if (dir)
{
for (i = 0; i < 256; i++)
{
if (dir) {
for (i = 0; i < 256; i++) {
DigisparkRGB(Led, i);
DigisparkRGBDelay(25);//1);
}
}
else
{
for (i = 255; i >= 0; i--)
{
} else {
for (i = 255; i >= 0; i--) {
DigisparkRGB(Led, i);
DigisparkRGBDelay(25);//1);
}
@ -56,3 +49,4 @@ DigisparkRGBDelay(25);//1);