down the rows to the final pixel in the bottom
right corner, I needed to reverse the order of
every other row. Then I filled the colored cell
with its hex RGB value and put a 0 in the pixel
that won’t light up and 1 in the pixel that will be
variable based on the color selector. After saving
the Excel as a comma-delimited .csv file, I opened
it using Notepad to extract the values in the
format I need for my code (Figure
C
).
I’m using the PROGMEM string modifier to
save the string into program memory, as these
images will quickly fill up the flash memory
without that command. An alternate method to
create the image string is to use a tool like LCD
Image Converter and copy the C source code
it generates.You will still need to reverse the
order of every other row; I posted a tutorial fully
explaining both methods at serinese.com/lol-ra-
lamp (you can get the complete code there too).
A series of IF statements determine which
image function to call based on the position of
the 8-way rotary switch.The potentiometer value
maps to a string containing the nine colors, so
you could add many more if you choose.
The next section contains the send and
receive functions. I copied most of it from Tom
Igoe’s sample LoRa program that loads with the
libraries. (My wife wouldn’t let me steal one of his
centerpieces, but I have no problem taking his
code.) If the send button is pressed, the position
of the image and color is sent to the partner lamp
as the LoRa message. On the receiving end, the
lamp will continually listen for a message from
its partner and then parse the two-character
message into the new image and color values.
I left out the callback confirmation because
I wanted to replicate the uncertainty of pre-
electronic communications. Think about how
much great literature wouldn’t exist without all
those missed connections! (Juliet: “Not dead IRL.
I H8 Paris.” Romeo: “K.”)
The final component is the partner image
display. This is a CASE statement that reads
the received color value and displays the
corresponding image locally. The partner lamp
will continue to display this image regardless of
what is selected locally. Only by sending an image
back can the image change, forcing both lamps to
always display the last image in the conversation.
Fritzing
C
4. BUILD THE LAMP ENCLOSURE
After I was confident the lamp would display and
transmit properly, it was time to package it up
in an enclosure. My local makerspace has an
Epilog Fusion laser cutter with a 20"×30” bed
so I was able to cut and engrave my enclosure
using a single 18"×9" sheet of 3mm Baltic birch.
Yes, I switch back and forth between metric and
Imperial, so what? Its not like I’m building a Mars
lander.
You can download the SVG file at serinese.
com/lol-ra-lamp. I made these plans using
the Rounded Box generator (with lid) at Boxes.
py (festi.info/boxes.py/RoundedBox). I like this
site because the tabs fit really tight, so I rarely
need glue. Once I had downloaded a template
for the outer enclosure, I used Inkscape to
add a 117mm×117mm window for the LED
matrix as well as holes for the various controls.
Next, I added the images and text around their
respective controls and sent it to the laser to
engrave and cut (Figure
D
).
D
97
make.co
M83_094-98_LoRaLamp_F1.indd 97M83_094-98_LoRaLamp_F1.indd 97 10/11/22 9:59 AM10/11/22 9:59 AM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset