Skip to content

Instantly share code, notes, and snippets.

View docprofsky's full-sized avatar

✨ Schuyler St. Leger docprofsky

View GitHub Profile
@docprofsky
docprofsky / alphaclockfive_settime.py
Created October 1, 2020 02:44
Script to set the time on the alpha clock five over serial
#!/usr/bin/env python3
import datetime, serial, sys
if len(sys.argv) != 2:
print(f'''Usage: {sys.argv[0]} <serial port>\n
This may reset the clock when opening the serial port.
example: {sys.argv[0]} /dev/ttyUSB0
will set the time on an Alpha Clock Five connected to /dev/ttyUSB0''')
exit(1)
@docprofsky
docprofsky / nrsc5-include.path
Created September 22, 2017 03:53
nrsc5 set include path
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fb4a6a6..b681cbc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -13,7 +13,10 @@ if (USE_FAST_MATH)
endif()
configure_file (config.h.in config.h)
-include_directories ("${CMAKE_CURRENT_BINARY_DIR}")
+

master

dmesg

[27746.335237] xhci_hcd 0000:00:14.0: power state changed by ACPI to D0
[27746.436191] xhci_hcd 0000:00:14.0: setting latency timer to 64
[27746.690194] usb 1-2: new full-speed USB device number 85 using xhci_hcd
[27746.719699] usb 1-2: New USB device found, idVendor=610b, idProduct=4653
[27746.719714] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[27746.719725] usb 1-2: Product: MAX3420E Enum Code
[27746.719733] usb 1-2: Manufacturer: Maxim

Set up build stuff

Make prefix

sudo mkdir /opt/roborio
sudo chown schuyler:staff /opt/roborio
# cp -r /usr/local/arm-frc-linux-gnueabi/ /opt/roborio/

Environment variables

@docprofsky
docprofsky / pixy_java_example.sh
Created January 18, 2017 03:41
Commands to build pixy Java bindings and run GetBlocks example
git checkout java
cd scripts/
./build_libpixyusb_swig_java.sh
cd ../build/libpixyusb_swig/
javac GetBlocks.java
java GetBlocks
@docprofsky
docprofsky / setup.py
Created December 8, 2016 05:08
libpixyusb macOS python build
#!/usr/bin/env python
from distutils.core import setup, Extension
# The paths used in this file are relative to: PIXY_ROOT/build #
pixy_module = Extension('_pixy',
include_dirs = [
'/opt/local/include/libusb-1.0',
'/opt/local/include',
@docprofsky
docprofsky / io-expander.py
Created November 28, 2016 02:31
GreatFET IO Expander API
from abc import ABCMeta, abstractmethod, abstractproperty
class GreatFETIOExpander(object):
"""Class representing a generic IO expander.
Values for the pin states are integers with the least significant bit
corresponding to pin 0 on the expander.
"""
__metaclass__ = ABCMeta
@abstractproperty
@docprofsky
docprofsky / heliopsis.gvp
Created September 29, 2016 05:09
Gerbv project with good colors for viewing a two layer board (heliopsis)
(gerbv-file-version! "2.0A")
(define-layer! 7 (cons 'filename "heliopsis-B.SilkS.gbo")(cons 'visible #t)(cons 'color #(29491 53970 65535)))
(define-layer! 6 (cons 'filename "heliopsis-B.Mask.gbs")(cons 'visible #t)(cons 'color #(6168 31552 65535)))
(define-layer! 5 (cons 'filename "heliopsis-B.Cu.gbl")(cons 'visible #t)(cons 'color #(0 0 65535)))
(define-layer! 4 (cons 'filename "heliopsis-F.Cu.gtl")(cons 'visible #t)(cons 'color #(65535 0 0)))
(define-layer! 3 (cons 'filename "heliopsis-F.Mask.gts")(cons 'visible #t)(cons 'color #(65535 31465 18972)))
(define-layer! 2 (cons 'filename "heliopsis-F.SilkS.gto")(cons 'visible #t)(cons 'color #(65535 48830 0)))
(define-layer! 1 (cons 'filename "heliopsis.drl")(cons 'visible #t)(cons 'color #(0 65535 0))(cons 'attribs (list (list 'autodetect 'Boolean 1) (list 'zero_supression 'Enum 1) (list 'units 'Enum 0) (list 'digits 'Integer 4))))
(define-layer! 0 (cons 'filename "heliopsis-Edge.Cuts.gm1")(cons 'visible #t)(cons 'color #(32768 65535 32768)))
(define-layer! -1
runtime = electron
disturl = https://atom.io/download/atom-shell
target = 1.0.2
$ npm i
> serialport@4.0.1 install /Users/schuyler/development/robopaint/main/node_modules/serialport
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download: https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.1/serialport-v4.0.1-electron-v1.0-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for serialport@4.0.1 and electron@1.0.2 (electron-v1.0 ABI) (falling back to source compile with node-gyp)
CXX(target) Release/obj.target/serialport/src/serialport.o
CXX(target) Release/obj.target/serialport/src/serialport_unix.o
CXX(target) Release/obj.target/serialport/src/serialport_poller.o