Start Back Next End
  
ZBasic Language Reference
21
ZBasic Microcontrollers
Option SerialReadStrobe Pin 12
' use pin 12 for the strobe
Option X10Interrupt
Option X10Interrupt <external interrupt designator>
Default: INT0
This option, available only on ATtiny and ATmega-based ZBasic devices, allows you to specify the
external interrupt to be used for the zero-crossing input needed for the low-level X-10 routines.  If used, it
must appear for the first time in the first module compiled and it must appear after the target device is
specified.
This option is not supported on VM devices with a VM version older than v3.0.6 and, moreover, only INT0
or INT2 may be specified for VM devices.  For native mode devices, it is not supported on xmega-based
devices and on mega-based devices the choice is limited to the external interrupts supported by the
device in the range INT0 through INT7
Example
Option X10Interrupt INT2
Option OCModulateEnable
Option OCModulateEnable <value>
Default: see discussion
This option, available only on ZBasic target devices that support OutputCapture modulation, specifies the
value to be used to enable output of the modulation carrier timer.   The default value, which varies by
target device, configures the modulation carrier timer to toggle the timer’s compare match output on each
compare match.  In certain special situations, a different value may be needed to achieve the desired
result.  The value must be specified such that it is suitable for logically ORing it into the timer’s control
register after having cleared the set of bits that control output mode.
Option Library
Option Library "<object-library-filename>"
Default: none
This option, which can only be used for native mode devices, specifies the name of an object library that
should be linked in when the executable is built.   Typically, this directive will appear in a declarations file
that identifies the public entities contained in the library.  If the specified filename does not have a path
prefix, it is assumed that the specified name is relative to the directory of the module containing the
directive.
This option may be used in multiple modules as needed.
Example
Option Library "mylib.a"
2.3.2 The Definitions Section
The definitions section of a ZBasic program may contain constant definitions, variable definitions,
subroutine definitions and function definitions.  There may be any number of each of these types of
definitions and the definitions may occur in any order.  It is a common practice, however, to place
constant and variable definitions at the top of the definitions section followed by subroutine and function
definitions.  On the other hand, some programmers prefer to define the constants and variables closer to
the routine or routines that use them.
Previous page Top Next page