Skip to content

Instantly share code, notes, and snippets.

@darianbjohnson
darianbjohnson / esp32-s2-touchpads.h
Created January 8, 2022 17:43
This is the function I use for wake-up and interrupts on the NEWT (which uses an ESP32-S2) https://www.crowdsupply.com/phambili/newt
#define TOUCH_CHANGE_CONFIG 0
//these defines are specific to the NEWT breakout board = https://www.crowdsupply.com/phambili/newt
#define BUTTON_A 14
#define BUTTON_A_NAME GPIO_NUM_14
#define BUTTON_A_TOUCH_NAME TOUCH_PAD_NUM14
#define BUTTON_B 13
#define BUTTON_B_NAME GPIO_NUM_13
#define BUTTON_B_TOUCH_NAME TOUCH_PAD_NUM13
# NOTE: Make sure you've created your secrets.py file before running this example
# https://learn.adafruit.com/adafruit-pyportal/internet-connect#whats-a-secrets-file-17-2
import board
from adafruit_pyportal import PyPortal
# Set a data source URL
TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
# Create the PyPortal object
pyportal = PyPortal(url=TEXT_URL, status_neopixel=board.NEOPIXEL)
@darianbjohnson
darianbjohnson / gist:d7ccc8a62a29dcc09a6108a48a76a1f9
Created June 28, 2020 18:54
Creating nested rounded rectangles (in order to mimic a star trek display)
stBLACK = 0x000000
stRED = 0xFF0000
stBLUE = 0x0000FF
tftWidth =480
tftHeight = 320
import board
import terminalio
import displayio