Skip to content

Instantly share code, notes, and snippets.

View Spirit532's full-sized avatar
๐Ÿ™‚

Andrey Spirit532

๐Ÿ™‚
View GitHub Profile
@Spirit532
Spirit532 / euler_pyopenvr_triad_thing.py
Created March 13, 2019 00:22
OpenVR/pyopenvr/triad_openvr - convert from mDeviceToAbsoluteTracking/hmdmatrix34_t to almost-not-broken Euler angles
#### This code converts the python hmdmatrix34_t equivalent that you get from pose.mDeviceToAbsoluteTracking into sort-of functioning Euler angles.
#### Euler angles are still Euler angles however, so be careful.
#From https://gist.github.com/awesomebytes/778d4a1720a0ec3af2086ff6a0b057c3
def from_matrix_to_pose_dict(matrix):
pose = {}
# From http://steamcommunity.com/app/358720/discussions/0/358417008714224220/#c359543542244499836
position = {}
position['x'] = matrix[0][3]
position['y'] = matrix[1][3]
@Spirit532
Spirit532 / pfeiffer_ppt-100.py
Created July 6, 2019 06:14
Pfeiffer protocol - reading a PPT-100 vacuum gauge through a USB->RS485 adapter and python
import serial
ser = serial.Serial('COM11', 9600, timeout=0.5) #open the rs485 adapter
while True:
ser.write(('0010074002=?106\r').encode()) #request pressure from PPT-100, pfeiffer protocol
result = ser.readline() #read pressure back, use timeout
#return value is this:
#adr ac prn ty value chk r
#001 10 740 06 100023 025 \r
@Spirit532
Spirit532 / arctis_draw_on_oled.c
Created July 14, 2021 10:39
SteelSeries Arctis Wireless Pro OLED display drawing
#ifdef WIN32
#include <windows.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include "hidapi/hidapi.h"
#pragma comment(lib, "hidapi.lib")
#define MAX_STR 255
@Spirit532
Spirit532 / 1InficonBPG400.cpp
Last active July 11, 2024 20:09
Simple ESP8266/Arduino program to fully read and interact with the Inficon BPG400 vacuum gauge via RS232. Uses an SSD1306 128x32 display to show the reading and miscellaneous things, the on-board boot pin button to turn on degassing, and an SPDT switch to change between measurement units.
/*
BPG-400 gauge reader
Copyright 2022 Andrey T.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWAR