Skip to content

Commit

Permalink
The default GPIO pin of HC-SR501 was changed from GPIO_12 to GPIO_19.
Browse files Browse the repository at this point in the history
  • Loading branch information
s5uishida committed Nov 24, 2019
1 parent a00dd01 commit 09624af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion conf/hcsr501.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# GPIO_18, GPIO_19, GPIO_12 or GPIO_13
#gpioPin=GPIO_12
#gpioPin=GPIO_19
#
#influxDB=false
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private HCSR501Config(String dirParam, String fileName) {
public static HCSR501Config getInstance() {
if (config == null) {
config = new HCSR501Config(ConfigParams.CONFIG_DIR_PARAM, ConfigParams.HCSR501_CONFIG_FILE);
List<String> gpioPins = Arrays.asList(config.getConfig(GPIO_PIN_KEY, HCSR501Driver.getName(RaspiPin.GPIO_12)).split("\\s+"));
List<String> gpioPins = Arrays.asList(config.getConfig(GPIO_PIN_KEY, HCSR501Driver.getName(RaspiPin.GPIO_19)).split("\\s+"));
for (String gpioPin : gpioPins) {
if (gpioPin.equals(HCSR501Driver.getName(RaspiPin.GPIO_18))) {
if (!gpioPinList.contains(RaspiPin.GPIO_18)) {
Expand Down

0 comments on commit 09624af

Please sign in to comment.