Skip to content

Instantly share code, notes, and snippets.

View donchan922's full-sized avatar
🐶
I'm fine.

donchan922 donchan922

🐶
I'm fine.
View GitHub Profile
$ cd /opt/pi4j/examples
$ javac -classpath .:classes:/opt/pi4j/lib/'*' -d . ControlGpioExample.java
$ sudo java -classpath .:classes:/opt/pi4j/lib/'*' ControlGpioExample
<--Pi4J--> GPIO Control Example ... started.
--> GPIO state should be: ON
--> GPIO state should be: OFF
--> GPIO state should be: ON
--> GPIO state should be: OFF
--> GPIO state should be: ON for only 1 second
Exiting ControlGpioExample
$ curl -s get.pi4j.com | sudo bash
$ java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)
// START SNIPPET: control-gpio-snippet
/*
* #%L
* **********************************************************************
* ORGANIZATION : Pi4J
* PROJECT : Pi4J :: Java Examples
* FILENAME : ControlGpioExample.java
*
* This file is part of the Pi4J project. More information about
$ cd /opt/pi4j/examples
$ javac -classpath .:classes:/opt/pi4j/lib/'*' -d . ControlGpioExample.java
$ sudo java -classpath .:classes:/opt/pi4j/lib/'*' ControlGpioExample
<--Pi4J--> GPIO Control Example ... started.
--> GPIO state should be: ON
--> GPIO state should be: OFF
--> GPIO state should be: ON
--> GPIO state should be: OFF
--> GPIO state should be: ON for only 1 second
Exiting ControlGpioExample
$ mkdir -p ~/Library/'Application Support'/'Sublime Text 3'/Packages/Default
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": false},
"context":
[
{ "key": "setting.tab_completion", "operator": "equal", "operand": true },
{ "key": "preceding_text", "operator": "not_regex_match", "operand": ".*\\b[0-9]+$", "match_all": true },
]
},
// { "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },
// { "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": false},
// "context":
// [
// { "key": "setting.tab_completion", "operator": "equal", "operand": true },
// { "key": "preceding_text", "operator": "not_regex_match", "operand": ".*\\b[0-9]+$", "match_all": true },
// ]
// },
$ sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list
$ sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list.d/raspi.list
$ sudo apt-get update
$ sudo apt-get -y dist-upgrade