Welcome Guest, you are in: Login

Fruit Of The Shed

Navigation (MMBasic)






Search the wiki

»


Page History: MAXIDASH dashboard and IDE

Compare Page Revisions



« Older Revision - Back to Page History - Newer Revision »


Page Revision: 2018/04/22 23:23


MAXIDASH is a dashboard, and an IDE of sorts, for the (colour) maximite.

MAXIDASH is a MMBASIC 4 program that runs on the MM to experiment with an MM and to build event-driven programs. You can interactively control pins/ports and enter values and formulas for pins, pretty much like you would enter values and formulas into a spreadsheet. The formulas can be saved and exported to a stand-alone .BAS program.

Image

The export feature currently saves the exported program as a .DSH file which is still an MMBASIC program, since the program itself saves as a .BAS file using the specified file name (ZZZZDASH by default). I'm currently using CHAIN to extend the program when formulas are entered by the user, but perhaps LIBRARY LOAD can be used instead to speed this up in the future.

Download MAXIDASH by selecting the attachments (upper right corner).

MAXIDASH is easy to use and can be easily extended by adding new functions you want to use in formulas, by extending the functions$ string in MAXIDASH.BAS and BASEDASH.BAS. For example, to add support for DS18B20(n), add "1:DS18B20," to functions$, where 1 means one argument is required.

Below are two simple MAXIDASH examples. The first is just a simple blinking LED (pin0 is switched each second using the timer value specified as T). The second example runs 8 LEDs on D0-D7 as a continuous wave of 4 LEDs lit up. These simple examples should give you a very basic idea how MAXIDASH is programmed:

PIN0LED = (T\1000) % 2

M0 = 1000
M1 = 125
M2 = 500
D0 = t % m0 < m2
D1 = (t+m1) % m0 < m2
D2 = (t+2*m1) % m0 < m2
D3 = (t+3*m1) % m0 < m2
D4 = (t+4*m1) % m0 < m2
D5 = (t+5*m1) % m0 < m2
D6 = (t+6*m1) % m0 < m2
D7 = (t+7*m1) % m0 < m2

For the second example, the variables M0, M1 and M2 can be interactively changed in MAXIDASH to influence the pattern, or you can create formulas for M0-M2 based on the timer value (t) or a key press (key) value, e.g. M2=key?10*key:M2 will set M2 to the ASCII value times 10 when a key is pressed.

For example, the following simple example sets D0 to 0 when key '0' is pressed and to 1 when key '1' is pressed, and toggles D1 and D2 with the 'a' and b' keys, respectively:

D0 = key=48 ? 0 : key=49 ? 1 : D0
D1 = key=97
D2 = key=98

Now, when you connect a 74HC595 shift register pin DS to D0, pin ST_CP to D1 and SH_CP to D2 you can now interactively control the shift register from the keyboard! Just type '0'/'1' to set bit value, shift one bit in with key 'a' and latch with key 'b'. Export the program as ZZZZDASH.DSH (or rename) and you can run ZZZZDASH.DSH as a fast standalone program or integrate it in a project.

It is also easy to shift values into the 74HC595 using a counter M2 of the "memory bank" that is initially set to M1=16 (for 16 half cycles) and to let M3 shift a bit into the register each cycle, starting with the initial value of M0. M0 is the value we want to shift in, for example &haa:

M0 = &haa
M1 = 16
M2 = M1 ? M1 : M2 ? M2-1 : 0
M3 = M1 ? M0 : M2%2 ? M3 : SHR(M3, 1)

The 74HC595 shift register pin DS connects to D0, pin ST_CP to D1 and SH_CP to D2:

D0 = M3%2
D1 = M1 ? 0 : M2 ? M2%2 : 0
D2 = key=98

When you interactively set M1 to 0 then the M2 counter will count down, triggering D1 to flip each cycle, and triggering M3 to shift from low to high bits into the register via D0.