Search form

Scratchpad

OVERVIEW

Scratchpad is where the BrainStem stores variable information that can be used for multiple reflexes. Information stored here can be used for many applications because, when a value is changed, the changes carry throughout the rest of the reflexes.

BrainStem application examples require that the BrainStem Support package. Acroname provides simulated BrainStem modules within this distribution that can be used, in the absence of hardware, using the Symonym application .

THE SETUP

There are several hardware components needed for this example:

40-Pin EtherStem 1.0 Module

40-Pin Development Board

Ethernet Cable

Power Supply

Computer

- OR -

Symonym Software Package

Example Setup

SCRATCHPAD

The Scratchpad serves as on-board RAM. It is communicated to by the host and reflexes. It is available to multiple processes at once as a shared location and makes inner process communication quick and easy. The Scratchpad provides a location to store important information that can be accessed and manipulated at any time, with the manipulations affecting all relevant processes.

DEVELOPING THE CODE

The mapEnable function utilizes a function call to primerIterate. The function primerIterate utilizes the System class and the Timer class. The Expiration entity of the Timer class is then used to adjust the length of time between Timer executions. Inside the Timer the System class utilizes the LED entity to get the current state of the User LED and to inverse that state. The Timer then uses a function call to primerIterate again.

Line 8 - Creates a variable in the scratchpad called timing.
Line 12 - Turns User LED off after timing.
Line 14 - Starts Timer [1].
Line 20 - Calls the primerIterate function.
Line 27 - Reads the current User LED state.
Line 28 - Inverses current User LED state.
Line 32 - Calls primerIterate function.

This site uses cookies which store data only to provide this site's services. We store and analyze only anonymized user data. We only keep personal information related to your orders which you can delete at any time. We do not receive or store any credit card information. Privacy Policy