How to control Raspberry Pi GPIO via http web server

control RPi GPIO via http server

You bought your Raspberry Pi, and managed to create a python script to turn on/off an LED via GPIO. Then you are wonder “How can I control the GPIO via a web page”? This is a common questions been asked repeatedly on Raspberry Pi StackExchange and Raspberry Pi user groups. Some would say you need Flask web framework, other would suggest to install LAMP (Linux, Apache, PHP and MySQL), very few aware that you can run a simple HTTP web server using python’s build-in http.server library, without installation of Flask or LAMP stacks. Continue reading “How to control Raspberry Pi GPIO via http web server”

How to plot cycling route using Google Maps API and Flask web framework

Plot cycling route using Google Map API and Flask

Other than tinkering electronics hardware and computer programming, I spend a lot of time on cycling, this article combines my cycling hobby with my programming skill and talk about how to plot cycling route using Google Map API and Python Flask web framework. Continue reading “How to plot cycling route using Google Maps API and Flask web framework”

Add Syntax Highlight to WordPress Blog


If you are a blogger and a programmer, the chances are that you will often shows some programming code on your blog. The codes that you shared may not be syntax-highlighted like what you see on your favourite text editor or IDE, but it is easy to add syntax highlight to your WordPress blog using Highlight.js (hljs). Continue reading “Add Syntax Highlight to WordPress Blog”

How to create Arduino Library from Arduino Sketch

how to create arduino library

On previous article, I wrote an Arduino sketch (i.e. program) for interfacing LCD 5110 display module with Arduino. Technically speaking the Arduino sketch that I developed is not an Arduino library yet. In this article, I will discuss on how to create an Arduino Library, or more precisely, how to convert the Arduino sketch into an Arduino library. Continue reading “How to create Arduino Library from Arduino Sketch”

How to use LCD 5110 (PCD 8544) with Arduino


When I was in Taiwan a month ago for my cycling trip, I went to the Guang Hua electronics market and bought a LCD 5110 display impulsively without any particular objective on how I’m going to use it. I figured that I will eventually used it in one of my hardware project in future, but for time being I just want to understand how it works. My goal is to understand how the LCD display works, and then write a library for it without rely on third-party library, and furthermore, with common APIs for both Arduino and Raspberry Pi. Continue reading “How to use LCD 5110 (PCD 8544) with Arduino”

DS18B20 temperature sensor data logger

DS18B20 interfaces with Raspberry Pi

DS18B20 is a temperature sensor which communicates over a 1-Wire bus that by definition requires only one data line for communication with a host controller. I like DS18B20 as compare to other popular low cost temperature sensors for its accuracy and reliability. According to the DS18B20 data sheet, DS18B20 provides a digital Celsius temperature output with an accuracy of +/-0.5°C in the range of -10°C to +85°C. Continue reading “DS18B20 temperature sensor data logger”