This file contains 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
//the Arduino map function. | |
#define MAP(x, in_min, in_max, out_min, out_max) (((x) - (in_min)) * ((out_max) - (out_min)) / ((in_max) - (in_min)) + (out_min)) | |
#define SIGN(i) ((i)>0? 1:(i)<0?-1:0) | |
#define MAX(a, b) ((a)>(b)?(a):(b)) | |
#define MIN(a, b) ((a)<(b)?(a):(b)) | |
#define ABS(a) ((a)<0?(0-(a)):(a)) |
This file contains 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
// 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 [ |
This file contains 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
//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 |
This file contains 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
@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 |
This file contains 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
/* | |
PinReadWrite.ino | |
//20170512 initial version | |
//20170517 uS timing (was mS), vars are longs, i2C start/stop, and clock IN data w/. | |
//20201002 Returns valid JSON. | |
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 |
This file contains 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
/* | |
Source from | |
http://forum.arduino.cc/index.php?topic=78881.msg1375885#msg1375885 | |
* Ahmad Byagowi ([email protected]) | |
* 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 |