This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psutil | |
from time import sleep | |
while True: | |
temperature = psutil.sensors_temperatures()['cpu_thermal'][0].current | |
print(temperature) | |
sleep(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import evdev | |
import json | |
# Get a list of connected HID devices | |
devices = [evdev.InputDevice(path) for path in evdev.list_devices()] | |
# Find the device that we want to use | |
hid_device = None | |
for device in devices: | |
print(device.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Project: http Lesson | |
Programmer: Shahrulnizam Mat Rejab | |
Board: TTGO ESP32 Display | |
Last Modified: 25 Sept 2022 | |
Website: http://shahrulnizam.com | |
*/ | |
#include <WiFiManager.h> | |
#include <HTTPClient.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
extract($_GET); | |
if(isset($_GET['data'])) | |
{ | |
require __DIR__ . '/vendor/autoload.php'; | |
$options = array( | |
'cluster' => 'ap1', | |
'useTLS' => true | |
); | |
$pusher = new Pusher\Pusher( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import board | |
import digitalio | |
import time | |
import busio | |
import binascii | |
TX = board.GP0 | |
RX = board.GP1 | |
uart = busio.UART(TX, RX, baudrate=9600, timeout=0.1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import board | |
import digitalio | |
import time | |
import busio | |
import binascii | |
TX = board.GP0 | |
RX = board.GP1 | |
uart = busio.UART(TX, RX, baudrate=9600, timeout=0.1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
References: | |
- https://github.com/domdfcoding/circuitpython-mfrc522 | |
- https://github.com/wendlers/micropython-mfrc522 | |
""" | |
from adafruit_bus_device.spi_device import SPIDevice | |
class MFRC522: | |
OK = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import board | |
import digitalio | |
import simpleio | |
import busio | |
import mfrc522 | |
NOTE_C5 = 523 | |
NOTE_G5 = 784 | |
buzzer = board.GP22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copy library adafruit_st7735r.mpy dan adafruit_display_text | |
import board | |
import time | |
import terminalio | |
import displayio | |
import busio | |
from adafruit_display_text import label | |
from adafruit_st7735r import ST7735R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import board | |
import digitalio | |
import time | |
import busio | |
btn1 = digitalio.DigitalInOut(board.GP1) | |
btn1.direction = digitalio.Direction.INPUT | |
btn1.pull = digitalio.Pull.UP | |
led1 = digitalio.DigitalInOut(board.GP0) |
NewerOlder