Note that there are some explanatory texts on larger screens.

plurals
  1. POAccessing wiringPi (GPIO) from java through JNI
    primarykey
    data
    text
    <p>I wanna access my Pi's GPIO through Java. Yes I know there is Pi4J, but I need to use a library called RCSwitch-Pi (on github), which sends 433mhz signals (well actually i believe it can do more than that but thats what i need)</p> <p>The thing is, if I use the library itself from plain c++, I can control my powerplugs and my signals are transferred. But once I use it from java via JNI the GPIO pin is never triggered. I plugged in a LED to check but no current is created. It goes all the way to the point of the script where it calls the functions </p> <pre><code>digitalWrite(this-&gt;nTransmitterPin, HIGH); delayMicroseconds( this-&gt;nPulseLength); } </code></pre> <p>but thats it. it doesn't actually do the "digitalWrite" but it does it if not called from Java.</p> <p>Yes I performed with SUDO privileges so that's not the problem :-/</p> <p>Also, this is sort of out of curiousity:</p> <p>in the code is says "delayMicroseconds" and the variable "nPulseLength" is set to 300. This means each amplitude is set for 300ms before the next one is called. so it could be as simple as:</p> <pre><code> _ _ | |_| |_ </code></pre> <p>for a 1010 or something. Anyways the 433mhz pulse would require each wave to be 60cm long or in other terms:</p> <p>2.30947 nanoseconds * the speed of light = 69.2361688 centimeters</p> <p>which would mean the GPIO switch would have to switch from 0 to 1 and back to 0 within 2.30 nanoseconds. Thats a hell of a lot less than 300 milliseconds for one state switch isn't it??</p> <p>just wondering...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload