Skip to content

Instantly share code, notes, and snippets.

@GluTbl
GluTbl / ESP32 as Bluetooth Keyboard
Last active March 26, 2020 15:23 — forked from manuelbl/README.md
[ESP32 as Bluetooth Keyboard] #ESP32
# ESP32 as Bluetooth Keyboard
With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.
For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.
In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone:
1. Go to your computers/phones settings
2. Ensure Bluetooth is turned on
@GluTbl
GluTbl / Node MCU pinmap
Last active July 24, 2020 12:51
[ESP8266 Pinout] Generic ESP8266 Module blinking inbuilt led #esp8226
Node MCU pinmap
D0- GPIO16
D1- GPIO5
D2- GPIO4
D3- GPIO0
D4- GPIO2
D5- GPIO14
D6- GPIO12
D7- GPIO13
@GluTbl
GluTbl / gamepad.py
Last active May 18, 2025 16:00
[HID gamepade move detect] #python
import time
from time import sleep
from pynput.mouse import Listener,Button, Controller
mouse = Controller()
def on_move(x, y):
global p1
p1=mouse.position
return False
@GluTbl
GluTbl / SystemInfoTCP.kt
Created April 12, 2020 11:18
TempMonitor over TCP #raspberry
import com.pi4j.system.SystemInfo
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
import java.net.InetAddress
import java.net.ServerSocket
import java.net.Socket
import java.text.ParseException
@GluTbl
GluTbl / i2cscanner.ino
Created April 16, 2020 11:53
ESP8266 I2C scanner #i2c scanner
/*
* i2c_port_address_scanner
* Scans ports D0 to D7 on an ESP8266 and searches for I2C device. based on the original code
* available on Arduino.cc and later improved by user Krodal and Nick Gammon (www.gammon.com.au/forum/?id=10896)
* D8 throws exceptions thus it has been left out
*
*/
#include <Wire.h>
@GluTbl
GluTbl / PlayerController.py
Last active May 7, 2022 14:46
Python VLC Controller #vlc #python
class player():
def __init__(self):
self.is_initiated = False
self.SEEK_TIME = 20
self.MAX_VOL = 512
self.MIN_VOL = 0
self.DEFAULT_VOL = 256
self.VOL_STEP = 13
self.current_vol = self.DEFAULT_VOL
@GluTbl
GluTbl / updater.sh
Last active March 29, 2021 08:00
[apt update and upgrade] #linux
#!/bin/bash
if [ $# -ne 1 ]
then
echo "Invalid arguments"
exit
fi
re='^[0-9]+$'
@GluTbl
GluTbl / client.py
Last active June 13, 2023 16:41
[UDP audio streaming] #python
import pyaudio
import socket
from threading import Thread
frames = []
def udpStream():
udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
while True:
@GluTbl
GluTbl / mynotify.sh
Last active March 29, 2021 08:03
[notify in linux from sudo or anything ] #linux #shell
#!/bin/bash
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-t|--time)
TIME="$2"
@GluTbl
GluTbl / sample.sh
Last active March 29, 2021 08:02
[sudo running in as user mode] #linux
#!/bin/bash
#Detect the name of the display in use
display=":$(ls /tmp/.X11-unix/* | sed 's#/tmp/.X11-unix/X##' | head -n 1)"
#Detect the user using such display
user=$(who | grep '('$display')' | awk '{print $1}' | head -n 1)
#Detect the id of the user
uid=$(id -u $user)