Start Back Next End
  
ZBasic Language Reference
20
ZBasic Microcontrollers
Example
Option Library "mylib.a"
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.
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.
BasicX Compatibility Note
In BasicX mode, all variables and constants must be defined
before the first subroutine or function in a module.
Each of these program items may be defined to be Public or Private.  A public item is visible to other
modules and may be referenced in the definitions contained in other modules.  A private item is visible
only within the module in which it is defined.  Generally speaking, unless there is a specific need for an
item to be public, it should be private.  If you make something private and later decide that you need to
reference it in another module, it is a simple matter to change the definition from private to public.
Previous page Top Next page