GithubHelp home page GithubHelp logo

mwyborski / rpi_i2c_bit_banging Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 4.0 19 KB

I2C bit banging bus with raspberry pi and wiringPi. Use any GPIO Pins as I2C Bus

License: MIT License

C 37.98% C++ 61.22% Makefile 0.80%

rpi_i2c_bit_banging's People

Contributors

earthlord avatar mwyborski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rpi_i2c_bit_banging's Issues

Change i2c speed

Hello, as I use a level shifter to make it work with a 5v i2c bus, I am limited with the i2c speed.
I tried to change the parameter "delayTicks_" but with the rpi4, the i2c_delay() function is still too fast and so it doesn't work.
I understand why you used a loop because usleep is limited to 80us but I suggest to replace it with delayMicroseconds() as wiringpi is used.
The new i2c_delay() function should be :

void i2cBitBangingBus::i2c_delay()
{
   // unsigned int index;
    //for (index = 0; index < delayTicks; index++)
    //    ;
    delayMicroseconds(delayTicks);
}

With delayTicks_ set to 5us when creating a bus, I manage to change the speed of 1Mhz to 100Khz ;)

#include <stdexcept> needed

Hello,

I am making a Youtube video that uses your library. It is a good one, thank you.

But to the top of that .cpp file one needs to add
#include
that nowadays seems to be needed for the error messages (Raspbian, Geany).

Would it be a problem for you to add it?

Best regards
Miika Kurkela

How to implement this libary

When I want to compile with your lib with g++ -g -Wall -fPIC lwiringPi -o PCA9685.o PCA9685.cpp i2c.o i get following error: .o: file not recognized: File format not recognized.
I had created the i2c.o with: g++ -O -lwiringPi -o i2c.o rpi_i2c_bit_banging.cpp

Solve my problem ?

I have a problem with my IMU(MPU6050) and my DAC(PCA9685). Im using on my IMU the I2cdevlib with DMP and it seems that is critical, when you attach another device on the I2c rail then and when, you comunicate with the DAC the IMU freezes, you connect a 1.8kOhm resistor to 3.3V on the used I2c pins ?

Thanks for your answer.

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.