If you want to let a LED blink or measure the temperature in your room, you can use SmallBASIC on a Raspberry PI now. As an example just connect a LED and a resistor to a GPIO-Pin of your Raspberry Pi, write a short SmallBASIC programm and enjoy the blinking LED.
import SmallBasicPIGPIO as gpio
const PIN_GPIO4 = 4
gpio.GPIO_SetOutput(PIN_GPIO4)
for ii = 1 to 5
gpio.GPIO_Write(PIN_GPIO4, 1)
delay(500)
gpio.GPIO_Write(PIN_GPIO4, 0)
delay(500)
next
News
SmallBasicPiGPIO does not support Raspberry Pi 5
Februrar 14 2024: SmallBasicPiGPIO uses the library PiGPIO. PiGPIO supports only Raspberry Pi 1 to 4 and Pi Zero 1 and 2. At the moment I don’t have a/the plan to port SmallBasicPiGPIO to the Raspberry Pi 5.
Update of SmallBasicPiGPIO to new SmallBASIC version 12.27
August 7, 2023
ADS1015 and ADS1115 analog voltage sensor added
July 19, 2022 - For details see: ADS1x15 Voltage Sensor
Advanced button example
Mai 17, 2022 - For details see Push Button
BH1750 Ambient Light Sensor added
April 11, 2022 - For details see: BH1750 Ambient Light Sensor
Setup and Pin numbering
Commands by Topic
- Basic GPIO commands: Input and output to the GPIO pins.
- DS18B20 Temperature Sensor: Measure the environment temperature.
- HD44780 compatible Text LCD Display: Print text on a cheap but highly readable text-only display.
- SSD1306 compatible OLED Display: Draw graphics on this small and very cheap black and white OLED display.
- BH1750 Ambient Light Sensor: Measure the ambient light.
- ADS1015 and ADS1115 Voltage Sensor: Measure voltages.
- SCD30 CO2, Temperature and Humidity Sensor: Powerfull and extrem precise sensor for measuring CO2, temperature and humidity.
Examples
- LED
- Push Button
- DS18B20 Temperature Sensor
- HD44780 Text LCD Display
- SSD1306 OLED Display
- BH1750 Ambient Light Sensor
- ADS1015 and ADS1115 Voltage Sensor
- SCD30 CO2, Temperature and Humidity Sensor