[HTML/IMAGE] Monitoring a touch sensor

[HTML/IMAGE] Monitoring a touch sensor

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

We will go through an example to print input signal of a touch sensor via a hyperlink embedded image by using a PHPoC Blue.

Image

Diagram

Image

Source Codes
1. index.php

Code: Select all

<html>
<head>
<title>PHPoC / <?echo system("uname -i")?></title>
<meta name="viewport" content="width=device-width, initial-scale=0.5">
<style> body { text-align: center; }</style>
</head>
<body>
 
<h2>
 
UIO / Catalex Touch Sensor<br>
 
<img src="uio_touch_sensor.jpg"><br>
 
<?php
 
include_once 
"/lib/sd_340.php";
 
define
("IN_PIN", 0);
 
uio_setup
(0, IN_PIN, "in");
 
$touch 
= uio_in(0, IN_PIN);
 
if($touch)
    echo "touch ON<br>\r\n";
else
    echo "touch OFF<br>\r\n";
 
?>
 
<br><a href="index.php">reload</a><br>
 
</h2>
 
</body>
</html>


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: 166
Joined: Mon Jan 20, 2014 4:40 pm

Return to Example

Who is online

Users browsing this forum: No registered users and 1 guest

cron