Close

Refactored rainbow

A project log for 2017 SCB: Very Basic Badge

How to make the supercon badge display your name.

carlynoramacarlynorama 11/12/2017 at 00:480 Comments

Looks exactly the same. Code different. 

At the top:

#define rainbow_numberofcolors 7
const unsigned short rainbowcols[rainbow_numberofcolors] = {
    rgbto16(255,0,0), rgbto16(255,165,0), rgbto16(255,255,0), rgbto16(0,128,0), rgbto16(0,0,255), rgbto16(75,0,130), rgbto16(238,130,238)
};

In the start:

unsigned int barheight = dispheight/rainbow_numberofcolors;
         for( i  = 0; i < rainbow_numberofcolors-1; i = i + 1 ){
             plotblock(0, i*barheight, dispwidth, barheight, rainbowcols[i]);
         }

Discussions