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 terminal commands Now you need to enter the following at the command prompt: [codesyntax lang=”bash”] sudo nano /boot/config.txt [/codesyntax] to open…
shedboy71
-
-
In this example we will write some text on a PCD8554 LCD display, this is also commonly known as the Nokia 5100 LCD and is quite a common LCD which can be found in many Arduino projects. It frequently comes as an LCD which you…
-
In this example we will add an LCD plate to our Raspberry PI, you could of course add an LCD and connect it up manually but this was an easier method which I wanted to investigate. Here i s a picture of the plate I purchased…
-
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 all you have to start up the raspian config tool, you do this as follows [codesyntax lang=”bash”] sudo raspi-config [/codesyntax]…
-
In this example we create a SQLite database and insert some sample data into it, we will use this database in later examples [codesyntax lang=”python”] import sqlite3 as lite import sys con = lite.connect(‘test.db’) with con: cur = con.cursor() cur.execute(“CREATE TABLE Jobs(Id INT, Name TEXT,…
-
Connect a push button to a GPIO pin and check for a button press Schematic Code [codesyntax lang=”java”] 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 { public static void main(String args[]) throws InterruptedException { System.out.println(“Push…