![]() The digital pins that are PWM enabled, are not read in case the PWM is in use. The Arduino performs a digital read on all the digital pins and an analog read on all the analog pins. This asks the Arduino to read all the pins and return the values in a single 30 byte string. ![]() This is the equivalent of analogWrite(pin, value) and can only be used on the PWM capable pins. This is the equivalent of digitalWrite(pin, value). INPUT, OUTPUT and INPUT_PULLUP are supported. This is the equivalent of the pinMode(pin, mode). So, what I did, is turn the Arduino UNO in a slave, waiting for the commands from the Raspberry Pi. It’s pretty simple and straight forward and works with a bunch of other devices. Already at an early stage I figured to use the I2C interface. ![]() Besides controlling them, I also wanted to be able to read the values on the pins, both digital & analog. My objective was to add a simple way to control the i/o ports on the Arduino both analog and digital from my Raspberry Pi. OK, I finally have the software up and running to control my Arduino (or up to 127 of them) from a single Raspberry Pi.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |