The Light Up fish tank started as a basic fish tank. The parts were used together to make the hardware and then placed on the underside of the tank stand, which allowed space for the parts to sit nicely. The hardware utilizes a toggle switch and a potentiometer. I used an X-Acto knife to drill two holes into the tank's stand, one for the switch and one for the potentiometer. The potentiometer also has a cardboard stopper added to its sitting place to avoid it moving around while being used. The circuit playground express is placed in the center and its neo pixel lights are the ones used to light up the fish tank. Some canals were made around the underneath to allow the alligator clips to be managed better.
The code is quite simple. It begins on start with setting pin A1 to up, which allows the toggling switch to be read. I also created a variable called Value, which is the value of the potentiometer. I then set up a forever loop where if a digital read comes from pin A1, it will set the Value variable to pin A5 where the potentiometer is, as well as remap it's low and high from 0 to 1023 to 0 to 255, which are the values of the brightness for the neo pixels. It then sets all neo pixels to pink and sets their brightness to the Value variable. This is done forever to always be updating the brightness as the value changes. There is also an else statement where if it is read again then it will do everything the same, but change the neo pixels to a light blue.
Comments