Big Hex Standard Library

The Standard Library is automatically added to your program when you run it on the machine, it adds many useful functions. It may help you to browse the standard library source code to better understand what is happening. This page lists all methods that are currently available.

proc delay();

Pauses execution for a short period of time.

proc longdelay();

Pauses execution for a long period of time.

proc verylongdelay();

Pauses execution for a very long period of time.

proc displayBitmap(arr);

Copies the array parameter into the display buffer memory. The array should be at least 16 values long

proc clearDisplay();

Writes 0s to the display buffer setting all LEDs off

proc memcpy(src, dst, size);

Copies size values from the src array to the dst array

proc memzero(src, size);

Sets size elements in the src array to 0

func mul(x,y);

Returns the result of x * y

func div(x,y);

Returns the result of x / y

func mod(x,y);

Returns x % y

func lsh(x, n);

Returns x shifted left by n positions

func rsh(x, n);

Returns x shifted right by n positions

func abs(x);

Returns the absolute value of x

func isOdd(x);

Returns true if x is odd

func isEven(x);

Returns true if x is even

proc sRand(x);

Initialises the random seed value to x

proc genRand(x);

Returns a random number from 0(inclusive) up to x(exclusive)

Alphabet

This family of functions is responsible for the bitmap alphabet. It is taken from this 16x16 Font. The alphabet contains upper and lower case letters, numbers as well as symbols for !, ?, @ and a smiley face (using the # character as X does not support unicode).

func getBitmapForChar(c);

Returns an array containing the bitmap representation of the character c. The array is returned by reference so should be treated as READ ONLY. To get a mutable copy see copyBitmapForChar

func copyBitmapForChar(c, arr);

Copies a representation of the character c into the passed arr array parameter

proc initAlphabet()
proc initUpperCase();
proc initLowerCase();
proc initNumbers();
proc initSymbols();

These functions initialise the bitmap alphabet. The initAlphabet method simply calls the other 4 methods. If you only need part of the alphabet you can choose to only call the initialisation method you require, this reduces code size and means less time writing to RAM. Initialising a character is required in order to get it’s bitmap representation using getBitmapForChar and copyBitmapForChar.