Pi RC-Switch

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

License

License

GroupId

GroupId

de.pi3g.pi
ArtifactId

ArtifactId

pi-rcswitch
Last Version

Last Version

1.4
Release Date

Release Date

Type

Type

jar
Description

Description

Pi RC-Switch
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Project URL

Project URL

http://pi3g.com
Source Code Management

Source Code Management

https://github.com/entrusc/Pi-RC-Switch

Download pi-rcswitch

How to add to project

<!-- https://jarcasting.com/artifacts/de.pi3g.pi/pi-rcswitch/ -->
<dependency>
    <groupId>de.pi3g.pi</groupId>
    <artifactId>pi-rcswitch</artifactId>
    <version>1.4</version>
</dependency>
// https://jarcasting.com/artifacts/de.pi3g.pi/pi-rcswitch/
implementation 'de.pi3g.pi:pi-rcswitch:1.4'
// https://jarcasting.com/artifacts/de.pi3g.pi/pi-rcswitch/
implementation ("de.pi3g.pi:pi-rcswitch:1.4")
'de.pi3g.pi:pi-rcswitch:jar:1.4'
<dependency org="de.pi3g.pi" name="pi-rcswitch" rev="1.4">
  <artifact name="pi-rcswitch" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.pi3g.pi', module='pi-rcswitch', version='1.4')
)
libraryDependencies += "de.pi3g.pi" % "pi-rcswitch" % "1.4"
[de.pi3g.pi/pi-rcswitch "1.4"]

Dependencies

compile (1)

Group / Artifact Type Version
com.pi4j : pi4j-core jar 1.1

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Pi RC-Switch

A Java library to control remote switch units using a RC Transmitter (like this one: http://www.watterott.com/de/RF-Link-Sender-434MHz) connected to the Raspberry Pi.

This is basically a port of Suat Özgür's RC Transmitter library for Ardunio which you can find here: https://code.google.com/p/rc-switch/

how to use?

You can then use the library in your maven projects like this:

<dependency>
    <groupId>de.pi3g.pi</groupId>
    <artifactId>pi-rcswitch</artifactId>
    <version>1.3</version>
</dependency>

The hardware RF-Link-Sender must be connected like this

  • DATA IN to any GPIO-Data-Pin on the Pi. This pin is then provided to the constructor.
  • VCC to +5V on the Pi (PIN2)
  • GND with a ground pin (PIN6 for example)

Then you can use the RF-Link-Sender like this:

//our switching group address is 01011 (marked with 1 to 5 on the DIP switch
//on the switching unit itself)
BitSet address = RCSwitch.getSwitchGroupAddress("01011");

RCSwitch transmitter = new RCSwitch(RaspiPin.GPIO_00);
transmitter.switchOn(address, 1); //switches the switch unit A (A = 1, B = 2, ...) on
Thread.sleep(5000); //wait 5 sec.
transmitter.switchOff(address, 1); //switches the switch unit A off

In this example the DATA IN is connected to GPIO Pin 0, the group address (which can be set on the switch unit) is 01011 and the switch unit to trigger is unit A.

how to build?

The entire project is build with maven. Just clone the master branch, open the directory in NetBeans and hit run. Or if you prefer the command line:

mvn install

should build everything correctly.

Versions

Version
1.4
1.3
1.2
1.0