Giter VIP home page Giter VIP logo

Comments (3)

puuu avatar puuu commented on August 23, 2024

Hi, nice to hear that USIWire is of interest.

Feel free to use USIWire as you like. In fact, ATTinyCore bundled it. Unfortunately, changes do not come back to this repository. Please also check ATTinyCore for modifications.

Why TwoWire? isn't it just called Wire in Arduino?

IMHO, the cleanest way would be to use this repository as a git submodule. The glue would be a Wire.h (in a different directory) with include <USIWire.h>. USIWire.h introduce already Wire. If you need TwoWire add a additional line into your Wire.h.

from usiwire.

MCUdude avatar MCUdude commented on August 23, 2024

Feel free to use USIWire as you like. In fact, ATTinyCore bundled it. Unfortunately, changes do not come back to this repository. Please also check ATTinyCore for modifications.

Thanks! I'll have a look at both libraries then.

Why TwoWire? isn't it just called Wire in Arduino?

The library itself and the object is called Wire. However, the class is called TwoWire. Here and here is examples of libraries that expect a TwoWire object to be passed to their constructors as arguments. These libraries wouldn't accept USIWire as their i2c driver.

I'm using submodules for the bootloader and Arduino core files, but I would prefer to have a copy of the library that I'm free to modify the code as I like. One example is changing the class name (USIWire -> TwoWire). Another example is to get this library to compile for the targets I'm using. At the moment this library does not compile for __AVR_ATmega325P__ and __AVR_ATmega645P__, so that's something I'll have to add to usi_io.h. The code examples bundled with this library appear to be written with ATtinys in mind, so the examples would also have to modified.

from usiwire.

puuu avatar puuu commented on August 23, 2024

The library itself and the object is called Wire. However, the class is called TwoWire. Here and here is examples of libraries that expect a TwoWire object to be passed to their constructors as arguments. These libraries wouldn't accept USIWire as their i2c driver.

I see, TwoWire is the class name. In this case typedef USIWire TwoWire; or more C++ style using TwoWire = USIWire; would do the trick in Wire.h.

At the moment this library does not compile for __AVR_ATmega325P__ and __AVR_ATmega645P__, so that's something I'll have to add to usi_io.h.

I would be happy about such tested pull requests.

from usiwire.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.