Home Blog Page 12

DS18b20 python example

This is follow on from the DS18b20 terminal example at http://www.pibits.net/learning/120.php , this time a python example Code import os ...

Connect a DS18b20 temperature sensor

Connect a DS18b20 temperature sensor to your Raspberry PI as follows. I used a breakout for this. In this example we will just be using...

PCD8554 LCD example

In this example we will write some text on a PCD8554 LCD display, this is also commonly known as the Nokia 5100 LCD and...

Share a folder with a Windows computer from a Raspberry Pi

Sharing files over the network is incredibly handy, when I was writing code examples to publish on this site it was useful to run...

Raspberry PI LCD plate

In this example we will add an LCD plate to our Raspberry PI, you could of course add an LCD and connect it up...

Enabling i2c on the Raspberry Pi

Getting an I2C device to work with your Raspberry PI requires a few steps, in this guide we show how to enable this. First of...

Python query SQlite database example

In this example we use the database we created in the create database example and we will simply display all rows in the database #!/usr/bin/python import...

Create a SQLite database with Python

In this example we create a SQLite database and insert some sample data into it, we will use this database in later examples import sqlite3...

Java GPIO push button example

Connect a push button to a GPIO pin and check for a button press Schematic Code import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalInput; import com.pi4j.io.gpio.PinPullResistance; import com.pi4j.io.gpio.RaspiPin; import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent; import com.pi4j.io.gpio.event.GpioPinListenerDigital; public class pushbutton { ...

Java clock speeds example

Another example using the pi4j library, this time displaying various clock speeds on your system import com.pi4j.system.NetworkInfo; import com.pi4j.system.SystemInfo; import java.io.IOException; import java.text.ParseException; public class clockinfo { ...