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 / 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 / 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 / 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 / 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 / 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 / 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!")