Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ralfdoering/motor_frt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

amFORTH controlling an Arduino motor shield

After having played with my Arduino motor shield (see G+ post https://plus.google.com/u/0/106774241636379495104/posts/Tm8v2re1iXS), I decided to rewrite the Arduino code to Forth. Why, you ask? Having used Forth back in the 90s (on 8 Bit Z80 clone and 8088 Intel PC), I still have some background in Forth and I love it ot interactively try out things. With Forth I get the command interpreter to control my robot for free and I have much shorter turn-around times.

Quick setup notes

  • Unfortunately you have to built your own amForth image, because the provided HEX files for Arduino boards ins amForth 5.1 do not have timers enabled
  • I will provide detailed setup instructions in the future…
  • after burning the amForth HEX to your Arduino, use amforth-shell.py from amForth to load app.frt. This will load all the deps and my code.
  • As I haven’t enabled turnkey, you have to call setup and setup_pwm
  • There are simple movement commands: left/right/forward/backward/stop. These do what the say, but stop after 1 second.
  • There is an alternate form for each command: left!/right!/forward!/backward!/stop!. They do NOT stop after timeout.
  • There are shortcuts l/r/f/b/s and l!/r!/f!/b!/s! available.

Included code

The following files are taken from amForth 5.1 (http://amforth.sourceforge.net/)

  • marker.frt
  • bitnames.frt
  • synonym.frt
  • ports-standard.frt

License

This code is published under the GNU Public License v2 (GPL).

About

motor_frt

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages