8 lines. Two styles. Smooth and really smooth.

Call the cops, we’re getting away with something. With having only 4 LED’s by using very smooth fades to create the illusion of continuous movement of a motorized light. Second style has a lot longer fade between LED’s, such that all LED’s overlap.

Requires 8 lines of code since each LED must both fade up and fade down (2 lines per LED). Yes, a rewrite could support from 3 up to all 9 LED Ports of the Morsel.

In a project, LED’s should be so close together or diffused as to be indiscernible individually.  That improves the perception that the bright spot moves between them and is not two separate light sources. That’s also why we never turn an LED completely off. If it stays on, it might look like a glint of reflection coming from somewhere else instead of a light source. To improve contrast, it might make sense to darken the inner side of each LED so that it doesn’t show through to the other side (we did not try this).

//Basic 4 banger revolving police light, smooth
//1 rotation in 1/2 second (2 per second)
//conceptually simple because each LED fades to the next LED

@125ms chn4 = fade from 100% to 1% for 125ms //west,chn4 dark at 250ms
       chn1 = fade from 1% to 100% for 125ms //North,chn1 peaks at 250ms 
@250ms chn1 = fade from 100% to 1% for 125ms //North,chn1 dark at 375ms
       chn2 = fade from 1% to 100% for 125ms //east,chn2 peaks at 375ms
@375ms chn2 = fade from 100% to 1% for 125ms //east,chn2 dark at 500ms
       chn3 = fade from 1% to 100% for 125ms //south,chn3 peaks at 500ms
@500ms chn3 = fade from 100% to 1% for 125ms //south,chn3 dark at 125ms
       chn4 = fade from 1% to 100% for 125ms //west,chn4 peaks at 125ms

//falls through to the end and replays
                  
//4 banger revolving police light, really smooth
//1 rotation in 1/2 second
//Conceptually a little more complicated because each LED fades for
//twice as long, is at max only when the opposite LED is at min
//Twice as smooth, brighter too, but less contrast corner to corner
//Each channel indented differently to make paired fades more visible

@125ms chn1 = fade from 0% to 100% for 250ms       //North will hit 50% when east starts
           chn3 = fade from 100% to 1% for 250ms   //south peaked, now fades 
@250ms   chn2 = fade from 1% to 100% for 250ms     //east bottomed out, climbing 
             chn4 = fade from 100% to 1% for 250ms  //west at peak, now fades 
@375ms chn1 = fade from 100% to 2% for 250ms       //north peaks, now fades
           chn3 = fade from 1% to 100% for 250ms   //south bottomed, now rises
@500ms   chn2 = fade from 100% to 2% for 250ms     //east peaks, now fades
             chn4 = fade from 1% to 100% for 250ms //west bottomed out, now rises

//falls through to the end and replays