Keil ARM MDK for
c e e ni
//draw 13 stripes - alternate red/white
//draw rest of display black
//double pixels of first row of 6 stars
//draw 4 more rows of 6 stars for total of
//draw 4 lines of 5 stars offset between 6
There are 13 stripes, which alternate red and white.
The stripes are drawn using the drawRect function. Our
flag doesn’t fill the entire LCD, so we must fill in the rest of
it (which is blue) with black. Our flag is flying in Photo 3.
Run It Up the Flag Pole Yourself
You too can fly your American flag on a CFAL9664B-
F-B1-CB device for around $50. With the exception of the
CFAL9664B-F-B1 and Nucleo-F030R8, you can add the
American flag source code, the CFAL9664B-F-B1 driver, the
Keil C compiler, and J-LINK upgrade to your Design Cycle
for free. NV
As you can see, once we establish the first row of six
stars, we simply copy that row of stars four more times at
the offsets within the blue star box of the flag. We then
copy five of the six stars in the original row of stars and
place them in rows between the six star rows.
Next, we’ll fill in the stripes:
; PHOTO 3. An LCD rendition of the American flag can be
rendered on the CFAL9664B-F-B1 using simple home-grown
pixel and rectangle functions.
March 2018 61