Giter Site home page Giter Site logo

Integrate GPIO functionalities about iot-engine HOT 6 OPEN

nubeio avatar nubeio commented on July 28, 2024
Integrate GPIO functionalities

from iot-engine.

Comments (6)

RaiBnod avatar RaiBnod commented on July 28, 2024

Hello @Aidan275, as you already did some code on C for doing GPIO operation. Can you please share the code.

I have created just a base class for generating the JNI libraries for doing communication with native C on commit: d72c520.

from iot-engine.

RaiBnod avatar RaiBnod commented on July 28, 2024

Adding additional info:

BBBiO example: https://github.com/Aidan275/BBBiO
Parent ticket: https://github.com/NubeIO/NubeEdge28/issues/1

from iot-engine.

RaiBnod avatar RaiBnod commented on July 28, 2024

@Aidan275 I had forked your C++ code and did small changes https://github.com/RaiBnod/BBBiO for testing. And for Java JNI call, I had made a Java micro-service base 478e478, where we can generate native library. With the help of the native build library and that Java native functional interface we can able to communicate with C.

But currently, it only supports digital read/write operations. And still we following todo tasks to complete on C:

  • setPinMode - Configures the mode of a pin
  • analogWrite - Write a PWM signal to an analog output pin
  • analogRead - Read the voltage at an analog input pin
  • attachInterrupt - Attaches an interrupt handler to detect changes on a digital input pin
  • detatchInterrupt - Remove an interrupt handler

Could you please help me on this.

from iot-engine.

cooperbrindle avatar cooperbrindle commented on July 28, 2024

Additional Information

Prepare C/C++ code (SPI/PWM/GPIO of BBB) with APIs which can be called from Java (http://jonisalonen.com/2012/calling-c-from-java-is-easy)

Main functions needed at the moment are:

  • setPinMode - Configures the mode of a pin
  • digitalWrite - Write a HIGH or LOW to a digital output pin
  • digitalRead - Read the status of a digital input pin
  • analogWrite - Write a PWM signal to an analog output pin
  • analogRead - Read the voltage at an analog input pin
  • attachInterrupt - Attaches an interrupt handler to detect changes on a digital input pin
  • detatchInterrupt - Remove an interrupt handler

Resources:

from iot-engine.

zero88 avatar zero88 commented on July 28, 2024

Java need to provide interface and build a header file then C++ implementation should be in
https://github.com/NubeIO/BBBiO

from iot-engine.

zero88 avatar zero88 commented on July 28, 2024

#70

from iot-engine.

Related Issues (20)

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.