Created
October 14, 2022 07:15
-
-
Save mattyoung101/ad314b476bf616ef78171d532f9d6bdd to your computer and use it in GitHub Desktop.
Moog firmware
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
#define SWA IN(3)==1 | |
#define SWB IN(4)==0 | |
EIGN(W,0) | |
ZS | |
BAUD(0)=57600 | |
BRKRLS | |
OFF | |
s = 1 ' State, 0=Off, 1=On 2=Off Requested | |
p = PA | |
r = 20 | |
WHILE 1 | |
IF 1 == 0' IF SWA == 0 | |
s = 2 | |
IF Bo == 0 ' Motor is not off.. fix that. | |
X ' Stop Motion | |
ZS ' Clear Errors | |
BRKRLS ' Release Brake | |
OFF ' Turn Drive Off | |
SLEEP ' Stop accepting RS-232 input | |
' Steering can now be turned | |
ELSE ' Motor is Off. | |
s = 0 | |
ENDIF | |
ELSE | |
s = 1 | |
WAKE ' Accept RS-232 Input | |
ENDIF | |
p=PA | |
w = W(0) | |
PRINT("P:",p,",S:", s, ",M:" , w, #13) | |
WAIT=r | |
LOOP | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment