This tutorial shows how to use examples in this package. It's very easy, just by some simple click.
Let's start!
PSP Overview
PSP includes libraries and examples. Examples is diverse, varying from "hello, world" to networking tasks and how to use various sensors/actuators in different way.
Sensors/actuators used for examples includes: LED, Buzzer, Touch sensor, Light sensor, Rotary Angle sensor, Ultrasonic sensor, Servo motor, Step motors.
PSP tree structure:
- ../lib : Libraries.
- ../example: examples
- /net: examples related to the networking function
- /01.php_task: examples of using network protocols (e.g. TCP, DNS, Email, MySQL ...)
- /02.html_text: examples of network configuration (e.g. IP Address, WiFi SSID and password ...) via web:
- /p4s: examples of using well-known sensors and actuators
- /01.php_task: examples of reading value from sensors and controling actuators
- /02.html_text: examples of monitoring sensors and control actuators via simple web page
- /03.html_image: examples of of monitoring sensors and control actuators via image-embedded web page
- /04.html5_text: examples of of monitoring sensors and control actuators via WebSocket
- /05.html5_graphics: examples of of monitoring sensors and control actuators via WebSocket with graphic user interface
- /net: examples related to the networking function
How To Use It
Video
Quick steps
- If the example uses a sensor, wire sensor to PHPoC device
- Connect PHPoC device to PC/Laptop via USB cable
- Make sure that PHPoC Debugger has been installed (If not, see How To)
- Open PHPoC Debugger, choose the right COM port, and click "Connect" button to connect PHPoC Debugger to PHPoC device
- Download PHPoC Support Package and unzip it
- Upload the related library files to /lib folder on PHPoC device. (It had better to upload all library files)
- Upload a example to PHPoC device
- If example needs to connect to Internet, configure network information for PHPoC device. (USB WLAN Dongle has to be inserted to PHPoC board)
- If the example contains init.php file, click "Run" button on PHPoC Debugger (in order to run the file internally in system loop). If the example contains index.php file, open a Web Browser and type IP address of PHPoC devices to access Webpage on PHPoC device.
Library Reference
Source Code Files
If you take a look to source code files of all examples in the PSP, you will realize that there are three kind of examples:
- First type: examples include init.php and task0.php files
- Second type: examples include only index.php file (may include some images)
- Third type: examples include all init.php, task0.php and index.php
- First type: These examples are type of applications that are run internally in system loop.
- Second type: These examples are type of applications that are run in response to HTTP request. They provides Webpage
- Third type: These examples are type of applications that are mix of two first types.
Other Resources