mathertel / Radio

An Arduino library to control FM radio chips like SI4703, SI4705, RDA5807M, TEA5767.
http://mathertel.github.io/Radio
BSD 3-Clause "New" or "Revised" License
300 stars 91 forks source link

Library on Leonardo #6

Closed nikolisan closed 1 year ago

nikolisan commented 8 years ago

Hello Matthias,

Thank you for this great library. I have to point out that this lib does work with only UNO at the moment. And that's because different boards use different pins for TWI communication using the Wire library. For Leonardo and Micro the pinout must be different than the shown on the examples:

FM Chip     |    Arduino
------------|------------
SDIO        |    D2
SCLK        |    D3

For more information on other boards use this link.

To solve the problem and make my chip (Si4703) work with the Leonardo, I changed the lines 36,38 in the SI4703.cpp accordingly:

#define resetPin 4
#define SDIO 2

I hope this is helpful to someone out there.

PS. I did try to update the SI4703.cpp with:

SI4703::SI4703(int sdioPin, int sclkPin, int rstPin) {
     // Something here
}

but didn't work. I guess it's something with the .h file. (I have absolutely no idea on how to use C++. Just learning).

And again thank you. This works like a charm!

mathertel commented 1 year ago

You are right. Leonardo and nano require changes, Maybe I add som doku (or can you create apull request for this ? )