BASIC Overview



The SEM is a variation of the Micromite created by Geoff Graham and runs MMBasic, a very capable and modern BASIC implementation.

MMBasic programs can be loaded from the micro SD card into the 40k of ROM (about 2000 lines of program code) space. There is no need for the old-style line numbers of outdated BASICS. 30,000 source lines are executed executed per second, at fastest processor clock rate. The clock can be slowed to save power, and the system can be put to sleep. A program on the SD card can be set to automatically run on powerup.

The annoyance of GOTO/GOSUB has been eliminated by the fact that the language supports subroutines with arguments and functions with arguments and returned data. Data/variables can be global in the program, or in local scope to the subroutine. The BASIC in the SEM keeps track of date and time, and an RTC (Real-Time Clock) module can be added to the SEM for precision. MMBasic includes millisecond timing features.

MMBasic

features

floating point, 64-bit integer, and string variables that can be stored in the chip's 50k of RAM space. Arrays are supported with arrays of floating point numbers, integers or strings. Arrays can have multiple dimensions. The language supports long variable names in the BASIC source. 2k bytes of variables can be saved in non-volatile memory.

The SEM connects to a PC via USB and appears as a serial port. A terminal program or a more advanced editor can then connect to the device using the serial port that appears when connected. Editing the source via a simple terminal program (VT-100 type) is supported with the in-built full-screen, color-syntax editor.

A large number of functions are built into MMBasic. These include character, number, and string handling. The language includes console print and input type of commands. The SEM graphics display is supported with multiple fonts and simple line/box/circle graphics commands. The micro SD card on the SEM can be used for program load/save, or saving and loading data.

A large number of hardware I/O routines ranging from simple input and output to various serial communication schemes is also supported. Common UART serial, SPI, I2C, 1-wire are supported directly in the language. The I/O pins along the top edge of the SEM can be populated with connections to many sensors and devices, both simple and complex. The I/O pins have various capabilities including analog input, PWM output, input interrupts, and pulse counting. Infrared (IR) signals can be sent/received with the inclusion of appropriate hardware. Select interface lines are 5V tolerant.


Commands Supported by MMBasic


AUTOSAVE
BOX
CFUNCTION CSUB CIRCLE CLEAR CLOSE CLS COLOR CONST CONTINUE CPU
DATA DATE$ DEFINEFONT DIM DO-LOOP DO_WHILE
EDIT END ERASE ERROR EXIT
FONT FOR-TO-STEP-NEXT FUNCTION
GOTO GUI
IF-THEN-ELSEIF-ELSE-ENDIF INPUT IR I2C
KEYPAD
LET LCD LIBRARY- LINE LINE-INPUT LIST LOCAL
MEMORY
NEW
ON_ERROR ON-KEY ONEWIRE OPEN OPTION
PAUSE PIN PIXEL POKE PORT PRINT PULSE-PWM
RANDOMIZE RBOX READ REM RESTORE RTC RUN
SELECT-CASE SERVO SETPIN SETTICK SPI STATIC SUB
TEMPR TEXT TIME$ TIMER TRACE
VAR
WATCHDOG
XMODEM

Functions Supported by MMBasic


ABS ACOS ASC ASIN ATN
BIN$
CHR$ CINT COS
DATE$ DEG
EOF EXP
FIX
HEX$
INKEY$ INPIT$ INSTR INT
LEFT$ LEN LCASE$ LOC LOF LOG
MAX MID$ MIN
OCT$
PEEK PI PIN PORT PULSIN
RAD RGB RIGHT$ RND
SGN SIN SPACE$ SQR STR$ STRING$
TAB TAN TEMPR TIME$ TIMER TOUCH
UCASE$
VAL

For full details on the language, view the Micromite User Manual here:
Linked file: Micromite Manual.pdf


If you have more information about certain modules, please feel free to Contact us! and share what you know. If you also have test or application code to share, that link is the way to share that - we would appreciate your experiences and input a lot!

If you are interested in purchasing the unique devices that are shown on these pages,
CircuitGizmos (link: CircuitGizmosOnline) sells many of these devices. Also Tindie has several of the CircuitGizmos devices for sale.

If you have questions about sensor modules like these, consider joining the Facebook group.
Join the 37 Sensors FB Group! We'd love to see you there. If you are interested in the CircuitGizmos products, the FB page to join is CircuitGizmos on FB

Sometimes the 37 sensor projects are described as
Instructables. This is the Instructable user to follow: Indestructable and YouTube channel and even follow on Instagram. Link back to us, please! We really like learning how our products are used.

All content, not otherwise posted with a copyright notice, is Copyright 2017+ to the owner of 37sensors.com.