javac -classpath :/opt/pi4j/lib/'*' filename.java
git add .
git commit -m "update message"
git pull origin main
git push origin main
the unit of t is millisecond.
example: jl_sleep(1000); sleep 1 second
note: if we want to set high/low, need to declare the pin as "output" or "input" first!
in file: lib/JVM/std/pi7.java
javac -classpath :/opt/pi4j/lib/'*' pi7.java
For Raspberry Pi GPIO "output" pin. Send HIGH to Arduino;
For Raspberry Pi GPIO "output" pin. Send LOW to Arduino;
For Raspberry Pi GPIO "input" pin. Read Arduino information.
get a random number between 0 and 1.
get a random integer number between 0 and 100.
If I set the PIN as of HIHG, the PIN will keep as HIGH until I reset it.
If I set the PIN as of HIGH, the PIN will keep as HIGH until program terminates.
Once the program terminates, all of the PINs will go back to LOW as default.