^65 - The Buzzer Port
This write only port the buzzer on a device. Every time you write to the port it beeps for 100ms. A solid tone can be achieved by creating a loop with a delay of 0.1s.
Examples
Example 1
Task to beep 3 times to confirm keypad is unlocked.
Task1()
{
Name="Beep Unlocked"
Start(0x1C,LightingArea,0xFF,0x16,0x00,0x00,0xFF) //Start on panel enable message
STA ^65,0 //Tone for 100ms
Delay(.3)
STA ^65,0 //Tone for 100ms
Delay(.3)
STA ^65,0 //Tone for 100ms
}
Example 2
Beep Template
//@ name="Beep Task"
//@ description="Turns the audible tone for a captivation or Antumbra Touch on and off via Start and Stop task or a bogus area."
//@ prerequisite="If bogus area is used:\nPreset 1 = On\nAny other preset(or opcode) = Off."
#const ToneArea 250 //@ Name="Tone Trigger Area" Type=Area Description="Select area to trigger from." Category="Area"
#const BeepDelay .5 //@ Name="Delay Duration" Type=DelayTime Description="How long to delay between beeps. A value of .1 makes a continuous tone." Category="Delay"
Startup1()
{
Name="Start Task"
}
Task1()
{
Name="Beep/Tone Task"
Loop: //loop point
STA ^65,0 //Tone for 100ms
Delay(BeepDelay)//Wait Xms
Jump(Loop) //Do it all over again
}
Task2()
{
Name="Control Task"
Start(0x1c,ToneArea,x,x,x,x,x) //This guy watches all logical (1c) messages to the Tone area. The "x"s are variables that mean anything goes.
Copy @0,~0,7 //When we see a message we copy the first 7 pieces of data into the memory with the first piece at memory location ~0.This stores area into ~1, preset into ~3
LDA ~3 //Load the preset just sent.
CMP #0 //Compare if it is a preset 1 (aka: Tone Start)
BRZ ToneON //Branch down and start the tone or beeps.
StopTask(1) //If we are not starting the tone we should stop it.
Null
ToneON: //Start the tone!
StartTask(1)
Null
}