Skip to content

Instantly share code, notes, and snippets.

💭
Dexter rocks!

JamesNewton

💭
Dexter rocks!
Block or report user

Report or block JamesNewton

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JamesNewton
JamesNewton / encoderdisk.jscad
Last active Oct 15, 2019
OpenJSCAD code to make an encoder disk, Moved to: https://github.com/JamesNewton/HybridDiskEncoder
View encoderdisk.jscad
// title : OpenJSCAD.org encoder disk
// author : James Newton
// license : MIT License
// revision : 0
// tags : hdrobotics.com
// file : encoderdisk.jscad
// http://openjscad.com/#https://gist.githubusercontent.com/JamesNewton/c8598878736442c440bbe41d086291ac/raw//encoderdisk.jscad
function getParameterDefinitions() {
return [
@JamesNewton
JamesNewton / BinHexExamples.c
Created Feb 2, 2018
Options for shortest possible binary to hex, multiple data types, light, fast, easy for the C compiler to optimize.
View BinHexExamples.c
//For a live version of this, see:
//https://ideone.com/HDqleJ
#include <stdio.h>
#define loctype long
//#define loctype short
//#define loctype double
//#define loctype float
#define value 3735928559 //a fun value which turns into DEADBEEF in hex.
#define EOL 13
@JamesNewton
JamesNewton / csv2OpenSCAD2png.bat
Created Jul 26, 2017
Render CSV data into png files for animation / video overlay via OpenSCAD
View csv2OpenSCAD2png.bat
@echo off
if NOT [%2]==[] goto :doit
echo Usage:
echo %0 data.csv script.scad parameters
echo Where:
echo - data.csv is a csv file where each line corrisponds to a single frame to be produced in the PNG file
echo.
echo - script.scad is the script which will render the line of data into the PNG frame.
echo The script should parse the line of data and render a valid output
@JamesNewton
JamesNewton / PinReadWrite.ino
Last active Jun 23, 2019
Simple Arduino script to set pins high, low, input, pull up, or analog/servo, clock in or out data, with timing/start/stop, and read all or a single pin back via serial IO.
View PinReadWrite.ino
/*
PinReadWrite.ino
Simple Arduino script to set pins high, low, input, pull up, or analog/servo,
clock out data with timing, and read all or a single pin back via serial IO.
Written for the tiny-circuits.com TinyDuino in the end effector of the
Dexter robot from HDRobotic.com, but generally useful to turn the Arduino
into a tool for generating test signals, and reading back results. Not as
powerful as the busPirate, but more flexible in some ways and much easier to
operate. Not a replacement for Firmata as this is intended to be used by a
@JamesNewton
JamesNewton / MassMind.org ENC1 3Wire ReadAngle Arduino
Created May 8, 2017
Arduino code to read the angle register from the MassMind.org ENC1 via 3 wire read only mode.
View MassMind.org ENC1 3Wire ReadAngle Arduino
/*
Source from
http://forum.arduino.cc/index.php?topic=78881.msg1375885#msg1375885
* Ahmad Byagowi (ahmadexp@gmail.com)
* Date : Aug 31, 2013
* All code (c)2013 Ahmad Byagowi Consultant. all rights reserved
20170508 Minor edits to improve clarity by James Newton.
*/
//c2 pin tied to ground for 3 wire mode
You can’t perform that action at this time.