Skip to content

Instantly share code, notes, and snippets.

View WayneKeenan's full-sized avatar

Wayne Keenan WayneKeenan

  • Eastbourne, UK
  • 17:45 (UTC +01:00)
View GitHub Profile
@WayneKeenan
WayneKeenan / pptx_test.py
Last active August 5, 2017 08:57
python-pptx slide creation test
from pptx import Presentation
# for adding shapes
from pptx.util import Inches
from pptx.enum.shapes import MSO_AUTO_SHAPE_TYPE
prs = Presentation()
@WayneKeenan
WayneKeenan / bluetooth_hci.py
Last active January 29, 2021 08:26
Bluetooth LE HCI Python test class
import socket
import fcntl
from ioctl_helper import _IOW, _IOR
import struct
import array
from subprocess import call
from time import sleep
from os import popen
# ---------------------------------------------------
@WayneKeenan
WayneKeenan / hci_ble_test.py
Last active March 28, 2020 00:14
Experimenting with Bluetooth LE HCI commands in Python
import socket
import fcntl
import struct
import array
# ---------------------------------------------------
# HCI Constants (https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/lib/hci.h)
# HCI ioctl Commands:
from inputs import devices, get_gamepad
print(devices.gamepads)
print(get_gamepad()) # the script will pause here until a joystick or button is pressed on the Gamepad
<!doctype html>
<html lang="en">
<!--
Pre-requisites:
Raspberry Pi 2 or 3: https://www.raspberrypi.org/
Raspberry Pi setup: TODO: Pi project will appear under https://github.com/TheBubbleWorks
@WayneKeenan
WayneKeenan / MeArm_BLE_Test.py
Last active February 17, 2016 10:01
MeArm Bluetooth LE Python example (low level)
#!/usr/bin/env python
#
# Description: Low level example of sending BLE messages to a MeArm Brain Board fitted with the HM-11 Bluetooth LE module
#
# 17/02/2016 Wayne Keenan (wayne.keenan@gmail.com)
#
# Deps:
# 1) MeArm should have the MeArm_BLE sketch programmed, found here: https://codebender.cc/sketch:244546
# 2) Adafruit Python BLE libray (see below)
#