This file contains hidden or 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 datetime | |
import pyvisa | |
import rigol1000z | |
rm = pyvisa.ResourceManager() | |
osc_resource = rm.open_resource("USB0::6833::1230::DS1ZD194301173::0::INSTR") | |
osc = rigol1000z.Rigol1000z(osc_resource) | |
while True: |
This file contains hidden or 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
Bus 001 Device 104: ID 239a:8118 Adafruit Camera | |
Device Descriptor: | |
bLength 18 | |
bDescriptorType 1 | |
bcdUSB 2.00 | |
bDeviceClass 0 | |
bDeviceSubClass 0 | |
bDeviceProtocol 0 | |
bMaxPacketSize0 64 |
This file contains hidden or 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
Bus 001 Device 093: ID 239a:8118 Adafruit Camera | |
Device Descriptor: | |
bLength 18 | |
bDescriptorType 1 | |
bcdUSB 2.00 | |
bDeviceClass 0 | |
bDeviceSubClass 0 | |
bDeviceProtocol 0 | |
bMaxPacketSize0 64 |
This file contains hidden or 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
#define ROLL_R(x, n) ({ typeof(x) tmp = x; (tmp >> n) | (tmp << (32-n)); }) | |
unsigned bcd_next(unsigned n) { | |
n = n + 1; | |
for(unsigned i=0; i<5; i++) { | |
if ((n & 0xf) == 0xa) { | |
n += 0x6; | |
} | |
n = ROLL_R(n, 4); |
This file contains hidden or 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
Bus 001 Device 067: ID 239a:8108 Adafruit Macropad RP2040 | |
Device Descriptor: | |
bLength 18 | |
bDescriptorType 1 | |
bcdUSB 2.00 | |
bDeviceClass 0 | |
bDeviceSubClass 0 | |
bDeviceProtocol 0 | |
bMaxPacketSize0 64 |
This file contains hidden or 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
Frame 466: 8768 bytes on wire (70144 bits), 8768 bytes captured (70144 bits) on interface usbmon1, id 0 | |
Section number: 1 | |
Interface id: 0 (usbmon1) | |
Encapsulation type: USB packets with Linux header and padding (115) | |
Arrival Time: Jan 21, 2024 12:53:45.304074000 CST | |
[Time shift for this packet: 0.000000000 seconds] | |
Epoch Time: 1705863225.304074000 seconds | |
[Time delta from previous captured frame: 0.032027000 seconds] | |
[Time delta from previous displayed frame: 0.032027000 seconds] | |
[Time since reference or first frame: 8.051458000 seconds] |
This file contains hidden or 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
Bus 001 Device 066: ID 239a:8108 Adafruit Macropad RP2040 | |
Device Descriptor: | |
bLength 18 | |
bDescriptorType 1 | |
bcdUSB 2.00 | |
bDeviceClass 0 | |
bDeviceSubClass 0 | |
bDeviceProtocol 0 | |
bMaxPacketSize0 64 |
This file contains hidden or 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
// build with arm-non-eabi-g++ -std=c++20 | |
#include <type_traits> | |
#include <array> | |
#include <stdio.h> | |
constexpr int decimal_to_bcd(int x) { | |
int scale = 1; | |
int result = 0; | |
for(size_t i = 0; i<5; i++) { |
This file contains hidden or 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
#!/usr/bin/python | |
import pulsectl | |
def default_source(pulse): | |
default_source_name = pulse.server_info().default_source_name | |
for source in pulse.source_list(): | |
if source.name == default_source_name: | |
return source |
This file contains hidden or 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
module cylindertext(text, size, font, r=undef, d=undef, pos=0, outside=true) { | |
sgn = outside ? 1 : -1; | |
echo(sgn); | |
if (pos < len(text)) { | |
r = is_undef(d) ? r : d / 2; | |
c = text[pos]; | |
m = textmetrics(text=c, font=font, size=size); | |
echo(m); | |
theta_advance = sgn * m.advance[0] * (180 / PI) / r; |