Embedded Programming

I decided to code a program for my final project, which would be moving towards the right amount of light (phototaxis). Looking at the options given, I felt that a Raspberry Pi 2040 board would be the best option, as I would have a lot of peripherals to add to my system. Once I finished reading the documentation, I went to Wokwi to simulate a program. I also approximated a light sensor as a potentiometer as I felt they would be similar in terms of reading voltage. The LEDS are to easily show which mode it is in.

When there is the right amount of light, the isopod will not move. The stepper motor does not spin, and the yellow light is on.

If there is not enough light, the isopod will move towards it. The stepper motor does spin, and the red light is on.

If there is too much light, the isopod will move away from it.

Files can be found here