
admin
Arduino based RGB Matrix LED tester

This is a very simple Arduino project which control the 16x32 RGB LED Matrix Panel via an 16pin IDC cable. The Arduino will continuously sending 5 set colours (Red, Green, Blue, White, Black) to the LED Matrix Panel that allow the technician to find out which part of the LED Matrix Panel is malfunction.
Removing Applications from Raspberry Pi
sudo apt-get –purge remove APPNAME #replace APPNAME with the name of the app you want to remove |
sudo apt-get remove scratch |
Raspberry Pi Digital Signage

Raspberry Pi Schedule Turn OFF/ON Display
sudo su - #switch to supuer user
crontab -e #edit crontab file
|
Put this line at the end of the file. This will turn off display at 5.30PM and turn on display at 8.30AM
30 17 * * * tvservice -o 30 8 * * * tvservice -p; fbset -depth 8; fbset -depth 16 |
* * * * * command to be executed - - - - - | | | | | | | | | +----- day of week (0-6) (Sunday=0) | | | +------- month (1-12) | | +--------- day of month (1-31) | +----------- hour (0-23) +------------- minute (0-59)
Raspberry Pi Schedule Reboot
sudo su - #switch to supuer user
crontab -e #edit crontab file
|
Put this line at the end of the file. This will reboot the Raspberry Pi at 1.30PM every day.
30 13 * * * sudo reboot |
* * * * * command to be executed - - - - - | | | | | | | | | +----- day of week (0-6) (Sunday=0) | | | +------- month (1-12) | | +--------- day of month (1-31) | +----------- hour (0-23) +------------- minute (0-59)
Configure the Raspberry Pi a Static IP Address
- Raspberry IP: 192.168.0.123
- Router IP (Gateway): 192.168.0.254
- Subnet Mask: 255.255.255.0
cat /etc/network/interfaces |
auto lo
iface lo inet loopback
iface eth0 inet dhcp allow-hotplug wlan0
iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp |
sudo nano /etc/network/interfaces |
address 192.168.0.123
netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.254 |
auto lo iface lo inet loopback allow-hotplug wlan0 |
cat /etc/resolv.conf |
nameserver 192.168.0.254 |
sudo nano /etc/resolv.conf |
Changing the Screen Resolution for Raspberry Pi

tvservice -s |
vcgencmd get_config int |
tvservice -d dataFile #dump information to dataFile edidparser dataFile #load dataFile & display on screen |
Raspberry Pi: Running Midori browser without a Desktop

Midori is a lightweight browser using the WebKit rendering engine and it is a default browser that is found in Raspbian. This is a quick quide to start the Midori browser from the command line without a desktop manager.
Setup a Raspberry Pi PHP web server

- Raspberry pi running Raspbian OS
- SSH client such as PuTTy
- If you like to use GUI ( Graphical User Interface), WinSCP is preferred
- Netscanner software for IP address searching
Some useful javascript

function create_XMLHttpRequest() { //create new XHR object if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } return xmlhttp; }
- Get replay from php web server: serverResponseInfo=httpGetRequest("http://domain/myReply.php")
- Read content from a text file: serverResponseInfo=httpGetRequest("myTextFile.txt")
- Read content from a text file: document.getElementById("myDiv").innerHTML=loadXMLDoc("myTextFile.txt");
function httpGetRequest(url)
{ xmlhttp= create_XMLHttpRequest(); xmlhttp.open("GET",url,false); xmlhttp.send(); return xmlhttp.responseText; } |
- To check a file if exist in www root directory: fileExists("/settings.xml")
- To check a file if exist in the current directory: fileExists("settings.xml")
function fileExists(filename) { xmlhttp= create_XMLHttpRequest(); //create new XHR object if(!xmlhttp) return false; try { xmlhttp.open("HEAD", filename, false); xmlhttp.send(null); return (xmlhttp.status==200) ? true : false; } catch(er) { return false; } }
function loadXML(XML_filename) { xmlhttp= create_XMLHttpRequest(); xmlhttp.open("GET",XML_filename ,false); xmlhttp.send(); return xmlhttp.responseXML; }
function xmlToString(xmlDoc){ if(xmlDoc.xml){ // MSIE xmlString = xmlDoc.xml; }else{ xmlString = (new XMLSerializer).serializeToString(xmlDoc); } return xmlString; }
function createString_accordingDate() { var today = new Date(); var dd = today.getDate(); var mm = today.getMonth()+1;//January is 0! var yyyy = today.getFullYear(); if(dd<10){dd='0'+dd} ; if(mm<10){mm='0'+mm}; return (yyyy + "_" + mm + dd); }