Skip to content

Instantly share code, notes, and snippets.

View PaulskPt's full-sized avatar

Paulus H.J. Schulinck PaulskPt

View GitHub Profile
@PaulskPt
PaulskPt / gist:b0d3e075f654658fc47c3a8f6c83aaa4
Last active September 24, 2022 20:32
UM_FeatherS2_with_CircuitPython_V7.3.3._WiFi_test
import time, gc, os
import board
import feathers3
import wifi
import socketpool
try:
from secrets import secrets
except ImportError:
print("WiFi secrets are kept in secrets.py, please add them there!")
@PaulskPt
PaulskPt / gamepadqt.py
Created February 25, 2024 19:45
Adafruit GamepadQT with Raspberry Pi 5B-8GB
# _*_ coding: utf-8 _*_
# SPDX-FileCopyrightText: 2024 Paulus Schulinck
#
# SPDX-License-Identifier: MIT
##############################
# NOTE: Blinka and other prerequisites have to be installed on the Raspberry Pi
# See: https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi
# Also: before running this script, activate the venv environment as explained in the Adafruit article.
# This script is tested on a Raspberry Pi 5B-8GB and an Adafruit Gamepad QT (product ID 5743),
# connected through a Sparkfun Qwiic PiHat (https://www.sparkfun.com/products/14459)
@PaulskPt
PaulskPt / code.py
Last active February 28, 2024 17:51
gamepadqt for CircuitPython
"""
Platform: Pimoroni Pico DV Demo Base (PIM588) + Pimoroni Pico Lipo board 16MB (PIM560) (RP2040)
Date: 2021-08-24
System flashed: adafruit-circuitpython-pimoroni_picolipo_16mb-en_GB-7.0.0-beta.0.uf2
This script is to test the functionality of the 'board.USER_SW' which I, @paulsk, happened to discover
during a REPL session, after issuing 'import board' followed by 'dir(board)'.
In the list of resulting functions/classes was: 'USER_SW'.
The command: 'dir (board.USER_SW)' results in: ['__class__'].
@PaulskPt
PaulskPt / code.py
Created March 25, 2024 23:05
CircuitPython test if board connected to USB
# SPDX-FileCopyrightText: 2024 Paulus Schulinck
#
# SPDX-License-Identifier: Unlicense
# Tested on board: Adafruit MAGTAG (ID: 4800)
def is_usb():
# Test if we're connected to USB
# If an error occurs we are on USB
ret = False
try:
from storage import remount
@PaulskPt
PaulskPt / code.py
Last active March 31, 2024 11:06
Lolin S3 PRO w CircuitPython V9.0.0-rc.0 test onboard SDCard, external Lolin e-Paper Display and external Adafruit Gamepad QT
# SPDX-FileCopyrightText: 2024 Paulus Schulinck
#
# SPDX-License-Identifier: MIT
###############################
"""
Platform: Lolin S3 PRO.
Attached hardware:
a) on-board: 32GB microSDCard (SPI);
b) external: Lolin 2.13inch Lolin e-Paper 3-color display, 250x122px (SPI);
c) external: Adafruit Gamepad QT (seesaw system) (I2C).
@PaulskPt
PaulskPt / DataToGoogle_MAGTAG
Last active April 8, 2024 11:23
Data_to_Google
/*
* -----------------------------------------------
* Originally published by Mogsdad@Stackoverflow
* Modified for jarkomdityaz.appspot.com
* Adapted for use on an Arduino Nano RP2040 Connect.
* 2022-08-01 adapted for use on an Adafruit MAGTAG datetime script by @Paulskpt Github.
* -----------------------------------------------
*
* GET request query:
* https://script.google.com/macros/s/<id>/exec/?date=$date&temp=temp&hum=hum$*
@PaulskPt
PaulskPt / __gamepadqt_and_aht20.py
Last active April 16, 2024 21:51
_Raspberry Pi 5B-8GB with GamepadQT and AHT20
# SPDX-FileCopyrightText: 2024 Paulus @PaulskPt on Github
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-FileCopyrightText: 2023 Kattni Rembor for Adafruit Industries
# SPDX-License-Identifier: MIT
"""
This is a Python script to test:
A Raspberry Pi 5B-8GB single board computer with, via I2C, connected:
a) an Adafruit Mini I2C Gamepad with seesaw - STEMMA QT / Qwiic (https://www.adafruit.com/product/5743);
b) an Adafruit AHT20 Temperatur & Humidity Sensor Breakout Board - STEMMA QT / Qwiic (https://www.adafruit.com/product/4566).
Added functionality to save data to two separate log files:
@PaulskPt
PaulskPt / Google_Apps_Script
Last active April 21, 2024 09:30
DataToGoogle_Raspi5_V2
/*
* -----------------------------------------------
* Originally published by Mogsdad@Stackoverflow
* Modified for jarkomdityaz.appspot.com
* Adapted for use on an Arduino Nano RP2040 Connect.
* 2022-08-01 adapted for use on an Adafruit MAGTAG datetime script by @Paulskpt Github.
* 2024-04-17 adapted for use on a Raspberry Pi. Added column D for board_id
* 2024-04-17 Created a new deployment (nr 8)
* -----------------------------------------------
*
@PaulskPt
PaulskPt / Google_Apps_Scripts_Script
Last active April 23, 2024 08:22
datatogoogle_raspi5_v3
/*
* -----------------------------------------------
* Originally published by Mogsdad@Stackoverflow
* Modified for jarkomdityaz.appspot.com
* Adapted for use on an Arduino Nano RP2040 Connect.
* 2022-08-01 adapted for use on an Adafruit MAGTAG datetime script by @Paulskpt Github.
* 2024-04-17 adapted for use on a Raspberry Pi. Added column D for board_id
* 2024-04-17 Created a new deployment (nr 8)
* 2024-04-20 Created a new deployment (nr 1) (used to call this script directly from a Python script without use of pushingbox.com)
* Note that in the deployment the Authorization has to be set to "anyone" because when it is set to "myself" send request from another device than