Skip to content

Instantly share code, notes, and snippets.

@Cleric-K
Cleric-K / motors.py
Created March 26, 2018 16:59
Automate motors
import serial, time
s = serial.Serial('COM19', baudrate=115200)
def cmd(c):
s.flushInput() # we are not reading the input so do not let the buffer grow indefinitely
s.write( (c + '\n').encode('ascii') )
cmd('#') # activate CLI
time.sleep(1) # give it some time to enter CLI mode
import msp, uinput, sys, time
if len(sys.argv) != 2:
print('Usage: {} SERIAL_DEVICE'.format(sys.argv[0]))
sys.exit(1)
m = msp.MultiWii(sys.argv[1])
m.ser.timeout = 100
events = (
@Cleric-K
Cleric-K / dbase_7.php
Last active March 20, 2021 08:21
Simple PHP class for reading records from dBase level 7 files
<?
/*
This is the class found at: https://stackoverflow.com/a/1953465
but modified to work with dBase level 7 dbf files.
*/
class Prodigy_DBF {
private $Filename, $DB_Type, $DB_Update, $DB_Records, $DB_FirstData, $DB_RecordLength, $DB_Flags, $DB_CodePageMark, $DB_Fields, $FileHandle, $FileOpened;
private $Memo_Handle, $Memo_Opened, $Memo_BlockSize;