- connect Pico via USB to Klipper Raspberry Pi
- Get the correct serial path with
ls /dev/serial/by-id/* - Add following file into klipper:
adxl.cfg - Content:
[mcu pico]
serial: /dev/serial/by-id/usb-Klipper_rp2040_mySerial
| import RPi.GPIO as GPIO | |
| import os | |
| BUTTON_PIN = 14 | |
| GPIO.setmode(GPIO.BCM) | |
| GPIO.setup(BUTTON_PIN, GPIO.IN) | |
| try: | |
| channel = GPIO.wait_for_edge(BUTTON_PIN, GPIO.RISING) |
| [ | |
| { | |
| "id": "6a823385.834cbc", | |
| "type": "tab", | |
| "label": "AWTRIX", | |
| "disabled": false, | |
| "info": "" | |
| }, | |
| { | |
| "id": "91c2dade.0c6518", |
| from imapclient import IMAPClient, DELETED | |
| import datetime | |
| SERVER = 'imap.yourdomain.com' | |
| USERNAME = 'mail' | |
| PASSWORD = '1234567890' | |
| FOLDER = 'INBOX' | |
| MAX_DAYS = 90 # emails older than was deleted |
| export interface HasId { | |
| id: string; | |
| } | |
| export interface HasOrderIndex { | |
| orderIndex: number; | |
| } | |
| export interface Dictionary<T extends HasId> { | |
| [id: string]: T; | |
| } |
| export class EnumHelper { | |
| /** check if the enum contains the value (case-insensitive) */ | |
| static hasEnumValue<T>(enumObject: T, enumValue: string): boolean { | |
| const hasEnumValue = Object.values(enumObject) | |
| .map((v) => v.toString().toLowerCase()) | |
| .includes(enumValue?.toLowerCase()); | |
| return hasEnumValue; | |
| } |