Skip to content

Instantly share code, notes, and snippets.

@tianic
tianic / robotcode4
Created April 22, 2014 19:09
Robot test code
VARIABLE CLOCK
VARIABLE MAIN
VARIABLE MAIN_OFFSET
VARIABLE LEGSV
VARIABLE SPEED 100 SPEED !
: TSET ( n -- ) \ set timer pins output period
\ max period of 65535 clock ticks
DUP TA0 PWM-PERIOD DUP TA1 PWM-PERIOD DUP TA2 PWM-PERIOD
DUP TA3 PWM-PERIOD DUP TB0 PWM-PERIOD DUP TB1 PWM-PERIOD
@tianic
tianic / FORTH Isomax servo test
Last active December 30, 2015 10:39
Isomax FORTH servo control test, proof of concept for the ServoPod board. Multitasking works great.
: TSET ( n -- ) \ set timer pins output period
\ max period of 65535 clock ticks
DUP TA0 PWM-PERIOD DUP TA1 PWM-PERIOD DUP TA2 PWM-PERIOD
DUP TA3 PWM-PERIOD DUP TB0 PWM-PERIOD DUP TB1 PWM-PERIOD
DUP TB2 PWM-PERIOD DUP TB3 PWM-PERIOD DUP TC0 PWM-PERIOD
DUP TC1 PWM-PERIOD DUP TD0 PWM-PERIOD DUP TD1 PWM-PERIOD
TD2 PWM-PERIOD ;
: PSET ( n -- ) \ set pwm pins output period
\ max period of 32767 clock ticks