I've got the PWM working fine now in my single purpose bare metal OS.
It's doesn't handle interrupts yet, but I have a GPIO class hierarchy that lets me blink the LED, and control the speed and direction of the DC motors. https://github.com/RazazRobotics/XiaoCa ... /gpiopin.h
Even though it's cpp I've made sure that no stdlib is in there, so a lot of stuff is really hacked right now. But more to the point:
I am now trying to get the Sharp IR distance sensor to work, and since it's Analog, I've been looking at analog to digital converters like this one:
https://learn.adafruit.com/raspberry-pi ... sh-ads1115
That distance sensor has a minimum operating voltage of 4.5v. I've also been reading that the I2C on the Pi's only outputs 3.3V and some have recommended a voltage regulator.
I already have this from a previous project https://images-na.ssl-images-amazon.com ... L1000_.jpg
My questions are:
1) With this analog to digital converter, https://learn.adafruit.com/raspberry-pi ... sh-ads1115, how can I connect multiple sensors? Do I need to get more than one of these? How does that work?
2) Will the voltage converter from above work fine? I think it should. Not sure exactly how the pinout will work if there's multiple sensors, but it should be able to take the 3.3 from the Pi and level it up to 5v with no problem. I used it to do the opposite in my previous project.
3) I have some physical space constraints on this project (it is a very small radio shack remote controlled car that I am replacing its brain with the Pi Zero). Can anyone recommend a good voltage regulator that's compact in size?