felias-fogg / SoftI2CMaster

Software I2C Arduino library
GNU General Public License v3.0
368 stars 100 forks source link

Fatal error at compile #17

Closed remygrandin closed 7 years ago

remygrandin commented 7 years ago

Hi,

I'm trying to use your library on an arduino due but the compiler don't seam to be on my side ^^

`SoftI2CMaster.h: 63:20: fatal error: avr\io.h: No such file or directory

include <avr\io.h>

`

do you have any idea why it won't compile ?

felias-fogg commented 7 years ago

Hi, the library is meant to run on ATmega and ATtiny MCUs. For ARM MCU such as the one on the Due, there is no way that the library will work because it is heavily based on using assembler code.

remygrandin commented 7 years ago

You should probably write that it's not compatible with the due or zero somewhere on the frontpage or on the the playground.arduino.cc page ^^

felias-fogg commented 7 years ago

It does say: "It can use any pins on any AVR chip to drive the SDA and SCL lines.“ AVR is the ATmega/ATXMega/ATtiny family. But I should say perhaps explicitly that it doesn’t run on ARMs.

Am 08.12.2016 um 16:48 schrieb remygrandin notifications@github.com:

You should probably write that it's not compatible with the due or zero somewhere on the frontpage or on the the playground.arduino.cc page ^^

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

felias-fogg commented 7 years ago

If you want to have flexibility concerning the pin usage (and this was probably the reason you tried my library, right?), you could actually use the i2cMaster library by landis that I mentioned in the Playground article: https://github.com/landis/arduino/tree/master/libraries/I2cMaster . You have to remove the TwiMaster class, because the hardware registers are named differently. However, then it works beautifully. I tested it on a Genuino Zero and the bus clock is around 100 kHz.