nanoFORTH  v2.2
nanoforth.ino.cpp File Reference

nanoFORTH example - 4 digit 7-segment display More...

#include "src/nanoFORTH.h"
Include dependency graph for nanoforth.ino.cpp:

Functions

void setup ()
 
void loop ()
 

Variables

const char code[] PROGMEM
 

Detailed Description

nanoFORTH example - 4 digit 7-segment display

Assuming you have a 12-pin 4 digit 7-segment LED hooked up as following

How To: Open Serial Monitor (or your favorate terminal emulator) as the console input to nanoFORTH

  • baud rate set to 115200
  • line ending set to Both NL & CR (if using emulator, set Add CR on, ECHO on)
  • type the following Forth code into Serial Monitor input

    WRD 1 TME

Function Documentation

◆ setup()

void setup ( )

< init Serial Monitor

  • setup nanoFORTH with preload Forth code

◆ loop()

void loop ( )

< execute VM of our NanoForth instance

Variable Documentation

◆ PROGMEM

const char code [] PROGMEM
Initial value:
=
": xx 999 FOR 34 DRP NXT ;\n"
": yy 99 FOR xx NXT ;\n"
": zz CLK DNG yy CLK D+ ;\n"