For instance PWM at 10kHz may be generated with 100 steps between off and fully on.Ĭlass to generate PWM on multiple GPIO. Script to show how waves may be used to generate PWM at (one) arbitrary frequency on multiple GPIO. To just transmit the wave with a bit time of 50 microseconds The time can be used to estimate the resistance.Ī program to generate a pulse on a GPIO every x seconds (1wave_pdif.c This C program uses pigpio notifications.įunction to hash a code from an IR receiver (reading an IR remote control).Ī program to display readings from the (I2C) PCF8591.įunction to time capacitor charging (through a resistance). Program to show status changes for a Hall effect sensor.Ī program to passively sniff I2C transactions (100kHz bus maximum) and display the results. Generally the method used is more complicated but more efficient than frequency counter 1. A frequency count is generated for each monitored GPIO (frequencies up to 500kHz with a sample rate of 1μs).
A frequency count is generated for each monitored GPIO (frequencies up to 500kHz with a sample rate of 1μs).Ī program showing how to use the gpioSetGetSamplesFunc function to set a callback for accumulated GPIO state changes over the last millisecond. If your program is called foobar.c then build withĪ program showing how to use the gpioSetAlertFunc function to set a callback for GPIO state changes. Improved methods of timing the start of the capacitor recharge are given for C and Python.Įxamples of using pigpio with shell code. Measuring brightness with a light dependent resistor (LDR). Pigpio pigpio C I/F pigpiod pigpiod C I/F Python pigs piscope Misc Examples Download FAQ Site MapĮxamplesThe following examples show various ways pigpio may be used to communicate with sensors via the GPIO.Īlthough many are complete programs they are intended to be a starting point in producing your own code, not an end point.Ī few practical examples of using pigpio with hardware.