About Txtzyme Plugin

Here is a program that will report what kind of microcontroller is connected. The v in Txtzyme prints the answer. The plugin runs this program when the page is opened and then reports the anser when it is received.

We can read from and write to electrical circuits by running small Txtzyme programs on microcontrollers attached to federated wiki servers. This plugin extends the Txtzyme language with words for running programs and collecting results over dedicated socket connections. github

OPEN v

The report might say "closed" if no connection was possible. Or just "1 sent" if Txtzyme won't respond.

As a rule of thumb, think of upper-case as talking to the Txtzyme plugin in the browser with everything else going to the Txtzyme interpreter in the microcontroller.

Read More About Txtzyme to learn more commands.

See More Txtzyme Examples in wiki and beyond.

Plugin Commands

The plugin adds commands to Txtzyme that run in your browser. These are words written all-caps and usually first thing on a line.

Say SECOND, MINUTE, HOUR and DAY to run repeatedly throughout the day.

HOUR 1o 1000m 0o

Say OPEN to run when the server connection is opened.

Say THUMB to run when scrubbing wiki data.

Say NL to run the program so far generated. (NL is short for newline, the traditional Txtzyme go command.)

Other all-cap words define Txtzyme fragments that will be put together to make complete programs. When they appear first in a line it is a definition, elsewhere it is a use of the definition.

CHANT FEE FIE FOE FUM

An all-cap _WORD_ bracketed by underscores will trigger WORD, but not until it is encounter by Txtzyme running on the microcontroller.

BEEP 600{1o 500u 0o 500u} _BOOP_ BOOP 500{1o 600u 0o 600u} _BEEP_

The underscore is the Txtzyme command for printing strings. The Txtzyme plugin recognizes the string as invoking a definition as a call-back, or string-back in this case. This lets us write safe infinite loops because the plugin stays involved.

Plugin Parameters

Commands run by the clock have available to them an array with [sec, min, hr] as a parameter. Say A to access the whole parameter or say A0, A1 or A2 to access the individual elements.

HOUR A2{ 1o 1000m 0o 1000m }

Commands run by THUMB has a key as a parameter which can be a number.

Numbers can be accessed as bits, B0, B1, B2 and so on from the least significant bit.

Numbers or strings can be accessed as characters, C0, C1, C2 and so on from the left most character. The ASCII value of the character is returned.

Numbers can be accessed as digits, D0, D1, D2 and so on from the units integer postion. Digits are represented by their ASCII values.

Other all-caps words refer to Txtzyme fragments that may include parameter accessors. For example FOO/43 calls FOO and sets the parameter to 43. To specify a parameter include it after the defined name separated by a slash. FOO/B3 passes forward one bit of the current parameter.

Commands run by string-back calls from Txtzyme will have an array of printed values as its argument.

LOOP 11s p _SAMPLE_ 200m _LOOP_