Start Back Next End
  
ZBasic System Library
ZBasic Microcontrollers
4
compiler directive in order to reduce the heap use.  The smallest PersistentSize that can be specified is
16 which would leave no space for your application's Persistent data.
Example: Option PersistentSize 512
Option <pin>
In addition to the four states (zxInputTriState, zxInputPullUp, zxOutputLow and
zxOutputHigh) two additional state modifiers, zxOpenDrain and zxActivePullup, may be specified
for A.0 through A.15.  Active pullup is the default mode for these pins.
Option TargetDevice
The compiler is directed to generate code for the ESP8266 when the target device is specified as
ESP8266.  That said, it is preferable to select the target device in the IDE rather than specifying it in the
application source code.
Option ConsoleSpeed
This directive may be used to specify the baud rate to which UART0 is initialized as part of the ZBasic
startup.  The default console speed is 19200.
Option MainTaskStackSize
The application's Main() subroutine is managed internally as if it were a task with its own separate
stack.  By default, the size of this stack is 4096 bytes.  This stack is used for all of the variables allocated
locally within ZBasic procedures (excluding those with the Static attribute) and for the call/return
tracking.  This stack use also includes space used by ZBasic System Library routines.
The System Library function System.TaskHeadroom() can be used to determine the amount of
unused space in the task stack.  This can be helpful in adjusting the stack size to meet the needs of your
application.
Option RTC
This compiler directive may be used to enable the ZBasic real time clock.  If it is enabled, the ESP8266
RTC hardware is used to update the ZBasic RTC tick count.  By default, the ZBasic RTC updates the tick
count every millisecond but you may specify a different rate using the device parameter RTCFrequency.
Option Include
Several pre-defined data types are available for the ESP8266 as noted below.  Each of these may be
included in your application by giving the name following Option Include.
Structure WifiScan_t
   Dim ssid as String          ' SSID
   Dim chan as Byte            ' channel number
   Dim auth as Byte            ' authorization mode
   Dim rssi as Integer         ' relative signal strength
   Dim mac(1 to 6) as Byte     ' MAC address
End Structure
Previous page Top Next page