Index

37 Sensors Overview

Sensor.Engine MICRO

  1. Sensor.Engine MICRO Features
  2. Pinout and Pin use
  3. BASIC Overview
  4. SEM Library functions

37+ Sensors

  1. Analog Hall-effect
  2. Analog Joystick
  3. Analog Temperature
  4. Ball Switch
  5. Bi-color LED
  6. Button
  7. Character LCD
  8. Flame
  9. Hall-effect Switch
  10. HMI Display
  11. Humidity and Temperature
  12. IR Receiver
  13. IR Transmitter
  14. Keypad
  15. LASER
  16. Light Cup
  17. Liquid
  18. Mercury Switch
  19. Microphone
  20. Multicolor Flashing LED
  21. Obstacle Avoidance
  22. Photo Interruptor
  23. Photoresistor
  24. Piezo Driver or Annunciator
  25. Pulse
  26. Reed Switch
  27. Relays and Drivers
  28. RGB LED
  29. Rotary Encoder
  30. Servo
  31. Shock and Impulse
  32. Speaker
  33. Temperature 18B20
  34. Temperature Threshold
  35. Touch Sensor
  36. Tracking
  37. Ultrasonic Distance

USBmicro U4xx

  1. U401
  2. U421
  3. U451

CircuitGizmos

Projects

  1. Controlling MedeaWiz Sprite

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


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