Skip to content

Instantly share code, notes, and snippets.

View scanner's full-sized avatar
🐍
Fiddling with python. Mostly.

Scanner scanner

🐍
Fiddling with python. Mostly.
View GitHub Profile
@stecman
stecman / _readme.md
Last active May 25, 2024 14:23
Brother P-Touch PT-P300BT bluetooth driver python

Controlling the Brother P-Touch Cube label maker from a computer

The Brother PTP300BT label maker is intended to be controlled using the official Brother P-Touch Design & Print iOS/Android app. The app has arbitrary limits on what you can print (1 text object and up to 3 preset icons), so I thought it would be a fun challenge to reverse engineer the protocol to print whatever I wanted.

Python code at the bottom if you want to skip the fine details.

Process

Intitially I had a quick peek at the Android APK to see if there was any useful information inside. The code that handles the communication with the printer in Print&Design turned out to be a native library, but the app clearly prepares a bitmap image and passes it to this native library for printing. Bitmaps are definitely something we can work with.

@electricimp
electricimp / ArduinoUART.device.nut
Last active December 23, 2015 22:59
Basic imp <--> Arduino code example
server.log("Device Started");
function arduinoData()
{
// Read the UART for data sent by Arduino to indicate
// the state of its LED.
local b = arduino.read();
while(b != -1)
{
@mrdoob
mrdoob / RequestAnimationFrame.js
Created February 22, 2011 14:50
Provides requestAnimationFrame in a cross browser way.
/**
* Provides requestAnimationFrame in a cross browser way.
* @author paulirish / http://paulirish.com/
*/
if ( !window.requestAnimationFrame ) {
window.requestAnimationFrame = ( function() {
return window.webkitRequestAnimationFrame ||