Embedded systems often need a small display. The programming required to support that distracts from the main focus of the project. IO pins are also costly. The simplest possible method of adding a display is desirable. Having a low cost separate processor to manage the display with an easy to load firmware and a simple command set seems like a good idea. A single serial tx pin (and rx if a touch screen is used) should be enough. Instead of using binary commands and supplying a library of code in every language,
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
| /* | |
| 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 |
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
| /* | |
| 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 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
| @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 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
| //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 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
| // 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 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
| //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 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
| //makes a dial for export as a DXF or SVG | |
| //needs finishing | |
| let resolution = 64 | |
| let slotfudge = 0.05 | |
| let slotlength = 2 | |
| function cutarc(r, a, i) { | |
| let arcwidth = .1// a/2 | |
| let curvedpath = CSG.Path2D.arc({ | |
| center: [0,0,0], |
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
| ;1000 years ago, when I was 17, I wrote a FORTH for the Z80 on a Trash 80. | |
| ;It was unique for the time, because it used the machine language RET as NEXT for asm words. | |
| ;e.g. the machine stack pointed NOT at the data stack or return stack but instead | |
| ; at the list of word addresses being executed aka the thread. | |
| ;That meant that asm words could be strung together even faster than a standard asm program | |
| ;because there was no asm CALL the RET was both the return from the current asm word AND | |
| ;the call to the next one. | |
| ;The address of the data and return stacks were kept elsewhere... | |
| ;one of the other registers or a memory location (I don't remember, code is long lost). | |
| ;I think it was IX and IY. |
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
| /* | |
| This code does direct communications in both directions with Dynamixel servos | |
| It doesn't use any libraries and provides minimal ping, write, read of registers | |
| Really useful more just to see how they work than anything else. | |
| I wrote it because a friend needed it to reduce code size on a minimal controller. | |
| In a real environment with a Dynamixel attached, it will monitor register 116. | |
| In testing / debugginer here, it uses the serial port to display testing results. | |
| Obviously, for a real connection, you need to implement the hardware and use an IO | |
| pin to switch the TX pin from driven to High-Z and wire it to the RX pin. | |
| See it run at: |