1st off, the MICROSWITCH is the microswitch ;) ,
and depressing it is BuTtoN T1.
Since the MICROSWITCH is an analog device with 2 analog axes -
not a digital coolie-HAT with 9 programmable positions (8-way + middle/center)
which are adressed via the standard BuTtoN-statements -
its axes can be split into up to 50 regions/bands(/positions) each
via any of the available 6 "digital axis"-statements
(actually, it's 4 main-types plus 2 variations).
If I got you right you'd like to use your MICROSWITCH as a 4-WAY HAT, right?
OK, you basically have 2 choices:
either 4-WAY with corners,
meaning that the corners generate the combined output of both neighboured main directions,
or pure 4-WAY without corners,
meaning that only the main directions will generate their assigned output
while the corners won't generate anything at all.
Now, the best "digital axis"-statement for this case is a "type 5",
which is an enhanced version of the original "type 2":
the "type 5" allows to specify the exact size of each region/band.
OK, you'll need (at least ;) ) 3 regions/bands for each axis
to separate out left/center/right respectively down/center/up;
the size of the outer (= off-center) regions/bands
depends on whether you want the "corners" to generate output or not.
Let's start with 4-WAY without corners:
MIY 5 3 (0 15 85 100) (/H macro_down) ^ [b]([/b]/H macro_up [b])[/b]
MIX 5 3 (0 15 85 100) (/H macro_left) ^ (/H macro_right)
Now 4-WAY with corners:
simply increase the size of the outer regions/bands :D :
MIY 5 3 (0 30 70 100) (/H macro_down) ^ (/H macro_up )
MIX 5 3 (0 30 70 100) (/H macro_left) ^ (/H macro_right)
Note that the values I've chosen are just examples which you can try -
if you don't like them, feel free to adjust them to match your own taste.
BTW, for these examples I've chosen "/H"eld macros
because if you do, you must use brackets like I did,
else the compiler will interpret "/H" and "macro_whatever" as 2 separate statements
and you'll get an error-message saying you've specified a wrong no. of bands/macros
(the compiler happens to be not that smart from time to time).
If you use the default "/N"on-repeating (old syntax) output,
then you don't have to use brackets, of course.
Note that the "/A"uto-repeating slash-modifier isn't allowed in "digital axis"-statements directly -
in case you should need this type of output, use "/H"eld logical flags instead
and then specify the desired "/A"uto-repeat code to this flag's BuTtoN-statement -
this way you'll indirectly get the desired result ;) :
MIY 5 3 (0 15 85 100) (/H X2) ^ ([b]/H X1[/b])
MIX 5 3 (0 15 85 100) (/H X3) ^ (/H X4)
BTN [b]X1 /A[/b] macro_up DLY(120)
BTN X2 /A macro_down DLY(120)
BTN X3 /A macro_left DLY(120)
BTN X4 /A macro_right DLY(120)
That's it, more or less :) -
as long as you don't need true 8-WAY operation for the MICROSTICK's axes
(always remember this: it's 1 device, sure, but consists of 2 analog axes!),
for then you'd need some logical programming to sort out these 8 directions...
Hope this helps.
As for your T1, that's easy ;) since it's simply a common BTN-statement
plus a standard syntax' DeLaY between both parts that are to be generated;
the delay's duration is specified in milli-seconds:
BTN T1 macro_1 DLY(990) macro_2
would generate a single non-repeated "macro_1", then "pause" for about a second
(keep in mind that one "frame" is around 30ms, hence I used "990" instead of "1000" -
just to include this info, for you wouldn't notice the difference anyway ;) )
before generating "macro_2", again not repeated but only once.
Note that it doesn't matter how long you hold T1 depressed:
the standard syntax' DeLaY always gets generated completely,
no matter whether you just quickly "tap" T1 or hold it for a longer time!
If you should want to make "macro_2" dependant on the time you depress T1,
then you'd need the logical DELAY-function... but I don't wanna confuse you
so I'll just stop here :D ...
Again, hope this helps,
Ulf
P.S.:
What's your problem ;) ? A lost manual?
You still can use Foxy's online-help :D !