Code

Sense hat text examples

These were just some text examples for the Sense hat [codesyntax lang=”python”] from sense_hat import SenseHat from time import sleep sense = SenseHat() green = [0, 255, 0] sense.show_message(“Hello!”, text_colour=green) [/codesyntax] [codesyntax lang=”python”] from sense_hat import SenseHat sense = SenseHat() yellow = (255, 255, 0)…

Read more

Sense hat environmental sensor examples

These are a few examples for the Sense Hat using the environmental sensors to get temperature, pressure and humidity [codesyntax lang=”python”] from sense_hat import SenseHat sense = SenseHat() while True: temp = sense.get_temperature() pres = sense.get_pressure() humi = sense.get_humidity() temp = round(temp, 1) pres =…

Read more

A look at the unicorn pHat

The unicorn pHat is a hat which althoough designed for the Pi Zero also works on other Raspberry Pi’s and has 32 RGB LEDs. There is a python library available for it and also a couple of C examples as well in the github repository…

Read more

Raspberry Pi and a PCF8591 example

The PCF8591 is a single-chip, single‑supply low‑power 8‑bit CMOS data acquisition device with four analog inputs, one analog output and a serial I²C‑bus interface. Three address pins A0, A1 and A2 are used for programming the hardware address, allowing the use of up to eight…

Read more

Raspberry Pi and MPU6050 python example

In a previous post we showed an example of the MPU6050 sensor and a Raspberry Pi using wiringPi and C++. This time its a python code example Raspberry Pi and MPU-6050 C example Code [codesyntax lang=”python”] import smbus import math import time # Power management…

Read more

Raspberry Pi and MPU-6050 C example

The MPU-6050 devices combine a 3-axis gyroscope and a 3-axis accelerometer on the same silicon die, together with an onboard Digital Motion Processor™ (DMP™), which processes complex 6-axis MotionFusion algorithms. The device can access external magnetometers or other sensors through an auxiliary master I²C bus,…

Read more

Raspberry Pi and PCF8574 example

The PCF8574 is an 8 bits I/O port expander that uses the I2C protocol. Using this IC, you can use only the SDA and SCL pins of your Arduino board to control up to 8 digital I/O ports. A0,A1,A2 are address pins P0,P1,P2,P3,P4,P5,P6,P7 are digital…

Read more

Raspberry Pi and HDC1008 temperature sensor

The HDC1008 is a digital humidity sensor with integrated temperature sensor that provides excellent measurement accuracy at very low power. The device measures humidity based on a novel capacitive sensor. The humidity and temperature sensors are factory calibrated. The sensing element of the HDC1008 is…

Read more

Raspberry Pi and BMP180 sensor

This bmp180 from Bosch is the best low-cost sensing solution for measuring barometric pressure and temperature. The sensor is soldered onto a PCB with a 3.3V regulator, I2C level shifter and pull-up resistors on the I2C pins. The BMP180 replaces the BMP085. Specification Pressure sensing…

Read more

Raspberry Pi and L3GD20 sensor

The L3GD20 is a low-power three-axis angular rate sensor. It includes a sensing element and an IC interface capable of providing the measured angular rate to the external world through a digital interface (I2C/SPI). The IC interface is manufactured using a CMOS process that allows…

Read more

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Read More