Git Product home page Git Product logo

pigpiohelper's Introduction

Raspberry GPIO Helpers

GPIO access via sysfs likely to be dropped see WiringPi/WiringPi#186 so Pin at now work only with Kernel < 6.6

How to build

mkdir build cd build cmake .. cmake . --build

This Repro is to using als git module. only Samples are here not an working app

Using

GPIO Output Pin

  auto pin1 = new GpioPin("1", true);
  pin1 << 1; // Switch on
  pin1 << 0; // Switch off

GPIO Input Pin

  void callback(const std::string& port, const int& value)
  {

  }

  auto pin1 = new GpioPin("1", pin_direction::in, pin_trigger::falling);
  pin1.Register(callback);

Callback is Called wenn pin input Falling

MCP23017 on I²C

   auto i2cBus = new I2CBus("/dev/i2c-1");
   auto mcpImpl = new MCP23017(i2cBus, 0x20);
   mcpImpl.SetPin(0, pin_value::on); // Set the 0 Pin On

MPU5060 on I²C (not working ok)

    auto i2cBus = new I2CBus("/dev/i2c-1");
    auto mpu = new MPU5060(i2cBus, 0x69);

I²C Tests

i2cdetect -y 1 -> Bus Scan

ds3231 has also 0x68 Base Adresse be carefull (GY512/MPU-6050) set AD0 to High

pigpiohelper's People

Contributors

derkleinepunk avatar

Watchers

 avatar

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.