Skip to content

Instantly share code, notes, and snippets.

View danimaciasperea's full-sized avatar

Daniel Macías danimaciasperea

View GitHub Profile
@danimaciasperea
danimaciasperea / RFWrapper.php
Created June 22, 2018 11:25
PHP Wrapper to send RF 433 Mhz commands using rpi-rf_send module.
<?php
function sendRF($lightId, $lightStatus) {
// 0, 1, 2, 3, 4, 5, 6
// entrada, lectura, tv, calduino, verde, deshumidificador, multiusos
$lightCode= array( 6, 10, 14, 83028, 86100, 70740, 21588);
$lightCodeDuration= array(205, 205, 205, 355, 355, 355, 355);
$sem_id = sem_get(RF_SEMAPHORE);