[TASK] Controlling a buzzer

[TASK] Controlling a buzzer

Postby admin » Wed Nov 04, 2015 3:31 pm

We will go through an example to control a buzzer by using a PHPoC Blue.

Image

PHPoC Blue Diagram
Image

Source Codes
1. task0.php

Code: Select all

<?php
 
if(_SERVER("REQUEST_METHOD"))
    exit; // avoid php execution via http request
 
include_once 
"/lib/sd_340.php";
 
define
("OUT_PIN", 0);
 
echo 
"PHPoC example : P4S-34X / UIO / Catalex Buzzer\r\n";
 
uio_setup
(0, OUT_PIN, "out low");
 
while(1)
{
    uio_out(0, OUT_PIN, HIGH);
    usleep(100000);
 
    uio_out
(0, OUT_PIN, LOW);
    usleep(900000);
}
 
?>


Please download a PSP (PHPoC Support Package) of libraries and examples from PHPoC, and upload it in the PHPoC Blue.




Video

phpBB [video]
admin
Site Admin
 
Posts: 153
Joined: Mon Jan 20, 2014 4:40 pm

Return to Example

Who is online

Users browsing this forum: No registered users and 2 guests

cron