mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 09:21:12 +03:00
Relay: Added C source
Signed-off-by: Sisinty Sasmita Patra <sisinty.s.patra@intel.com>
This commit is contained in:

committed by
Noel Eck

parent
af417d3ae1
commit
b266f87450
@ -88,7 +88,7 @@ link_directories (${MRAA_LIBDIR})
|
||||
# grove* will use module grove
|
||||
add_example (hmc5883l)
|
||||
add_example (groveled)
|
||||
add_example (groverelay)
|
||||
add_example (relay)
|
||||
add_example (light)
|
||||
add_example (temperature)
|
||||
add_example (grovebutton)
|
||||
|
@ -33,7 +33,7 @@ main(int argc, char **argv)
|
||||
//! [Interesting]
|
||||
|
||||
// Create the relay switch object using GPIO pin 0
|
||||
upm::GroveRelay* relay = new upm::GroveRelay(0);
|
||||
upm::Relay* relay = new upm::Relay(0);
|
||||
|
||||
// Close and then open the relay switch 3 times,
|
||||
// waiting one second each time. The LED on the relay switch
|
@ -46,7 +46,7 @@ add_example(GroveMQ3 gas)
|
||||
add_example(GroveMQ9 gas)
|
||||
add_example(O2Example o2)
|
||||
add_example(GroveQTouch at42qt1070)
|
||||
add_example(GroveRelaySample grove)
|
||||
add_example(RelaySample grove)
|
||||
add_example(GroveRotarySample grove)
|
||||
add_example(GROVESCAMSample grovescam)
|
||||
add_example(SlideSample slide)
|
||||
|
@ -22,11 +22,11 @@
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
public class GroveRelaySample {
|
||||
public class RelaySample {
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
// ! [Interesting]
|
||||
// Create the button object using UART
|
||||
upm_grove.GroveRelay relay = new upm_grove.GroveRelay(5);
|
||||
upm_grove.Relay relay = new upm_grove.Relay(5);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
relay.on();
|
@ -26,7 +26,7 @@
|
||||
var groveSensor = require('jsupm_grove');
|
||||
|
||||
// Create the relay switch object using GPIO pin 0
|
||||
var relay = new groveSensor.GroveRelay(0);
|
||||
var relay = new groveSensor.Relay(0);
|
||||
|
||||
// Close and then open the relay switch 3 times,
|
||||
// waiting one second each time. The LED on the relay switch
|
@ -24,7 +24,7 @@ import time
|
||||
import pyupm_grove as grove
|
||||
|
||||
# Create the relay switch object using GPIO pin 0
|
||||
relay = grove.GroveRelay(0)
|
||||
relay = grove.Relay(0)
|
||||
|
||||
# Close and then open the relay switch 3 times,
|
||||
# waiting one second each time. The LED on the relay switch
|
Reference in New Issue
Block a user