[HTML/IMAGE] Using a rotary angle sensor

[HTML/IMAGE] Using a rotary angle sensor

Postby admin » Wed Nov 04, 2015 4:00 pm

We will go through an example to print input signal of a rotary angle 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>
 
ADC / Catalex Rotary Angle Sensor<br>
 
<img src="adc_rotary_angle.jpg"><br>
 
<?php 
 
include 
"/lib/sd_340.php";
 
adc_setup
(0, 0); // adc0, channel 0
 
$adc_in 
= adc_in(0, 30);
 
printf
("Voltage : %.2fV<br>\r\n", $adc_in / 4095.0 * 3.3);
 
?>
 
<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.

Image


Video

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

Return to Example

Who is online

Users browsing this forum: No registered users and 1 guest