Control LED and buzzer feedback
The VTAP100 has two diagnostic LEDs, red and green, which provide a heartbeat on the board, for factory use only. There are also user feedback LEDs, on the reverse side of the board, which are visible through a window in the case. These can show any hex RGB colour. There is also a buzzer on both VTAP50 and VTAP100. You control how the LEDs and buzzer react to passes, cards or tags by setting parameters including LED or Beep in the config.txt file.
Note: Not all VTAP50 have built in LEDs.
!VTAPconfig
LEDSelect=1
LEDDefaultRGB=1EEBCF
PassLED=00FF00,100,100,2
PassBeep=100,100,2
TagLED=00FF00,100
TagBeep=100
LEDSelect=1 is to make use of the pair of LEDs that are visible through a compact case (CC) for user feedback, but you could use LEDSelect=2 to use the LED that is visible through a square case (SQ) instead. (When driving VTAP50 external LEDs use LEDSelect=0 for external RGB (common cathode), LEDSelect=1 or =2 for external RGB (common anode), or LEDSelect=3 for external or on‑board serial LEDs where fitted.) LEDDefaultRGB=1EEBCF sets the colour that the feedback LED(s) show constantly, but can be set =0 if you would rather LEDs were off when a pass is not being read.
PassLED chooses the hex colour for the LEDs to flash when there is a mobile pass read, along with the flash on time, interval between flashes and number of repeats, the example chooses two 100ms flashes with 100ms intervals in between. TagLED sets the LED response to a card/tag read in the same way. In the example the response to a card/tag is set to be the same colour, but a single 100ms flash (interval between flashes and number of repeats can be omitted if not needed).
PassBeep sets a beep on time, interval between beeps, and a number of repeats for the buzzer when there is a mobile pass read. Buzzer frequency can be changed on hardware from VTAP100 v5 or VTAP50 v2 onwards.
VTAP50 serial LEDs
On VTAP50 v2 boards with firmware from v2.1.11.2, a chain of serial LEDs can be connected to the serial LED connection on the expansion header.
A chain of serial LEDs supports more complex LED options and requires a special text file to control their behaviour, to control the colour of each LED separately and create combinations or sequences of LED patterns.
LEDMaxSerial defines the length of the attached LED chain. The current maximum value for external serial LEDs is 255.
Please contact vtap-support@dotorigin.com if your requirement is for more than 255 LEDs.
Note: Where status LEDs are fitted alongside a chain of serial LEDs, they will duplicate the behaviour of the first two LEDs in the chain.
There is an example leds.ini file
Be aware that, if your requirement is very simple, a small section of the leds.ini file can be included in the config.txt file, to avoid the need for a separate file. For instance:
[leds.blue]
000010=1-10
[end.leds]
LEDDefaultRGB=000000:leds.blue@config.txt
This example defines a sequence where serial LEDs 1 through 10 in the series show a dark blue (#000010).
Type these lines in a text file called leds.ini.
[leds.red]
FF0000=1-10
[leds.green]
00FF00=1-10
[leds.blue]
0000FF=1-10
[seq.rgb]
repeat=forever
frame=500,leds.red
frame=500,leds.green
frame=500,leds.blue
Add these lines to config.txt to call the text file leds.ini.
LEDDefaultRGB=FFFFFF:seq.rgb@leds.ini
This example defines a sequence where serial LEDs 1 through 10 in the series show red, then blue, then green on a loop.
Playing beep sequences or tunes
On VTAP100 v5 or VTAP50 v2 hardware onwards, the buzzer frequencies can be changed by specifying a sequence, in a very similar way to specifying sequences for serial LEDs.
A configuration section name and/or file name can follow any of the standard buzzer commands (TagBeep, PassBeep, PassErrorBeep or StartBeep to describe a sequence of beeps.
When a section is specified but no file, it is assumed the beep sequence will be defined in an leds.ini file, potentially alongside serial LED sequence definitions.
If your requirement is very simple it can be defined within the config.txt file, to avoid the need for a separate file. This is shown in the first example below. A more complex beep sequence can be more easily managed in a separate file. The second example uses a text file named beeps.ini, though any short file name could be used (following the xxxxxxxx.xxx format, up to 8 characters with a 3 character optional extension).
[tagbeep]
repeat=2 ; repeat sequence twice
tempo=120 ; set to 120 beats-per-minute
note=100,440 ; 440Hz for 100ms
note=50,220 ; 220Hz for 50ms
[end.tagbeep]
TagBeep=100:tagbeep@config.txt
This example plays a short 4 note sequence. (Note: If the tagbeep section could not be found, for example if the section name was mistyped, the TagBeep action would default to a single 100ms beep at default frequency, simply ignoring the sequence part of the configuration line.)
Type these lines in a text file called beeps.ini.
[tagbeep]
repeat=2 ; repeat whole sequence twice
tempo=120 ; set to 120 beats-per-minute
note=w,C6 ; whole note of C6
note=16s,A#5 ; 16 sixteenth note lengths of A#5 (same as 1w)
tempo=90 ; slow down the tempo for the remainning notes
note=250 ; rest for 250ms
note=w ; rest for one whole note
note=7e,Gb6 ; seven eighth notes of Gb6
note=100,440 ; 440Hz for 100ms
note=100,C4 ; C4 for 100ms
note=q,440 ; 440Hz for one quarter note
Add these lines to config.txt to call this section in the text file beeps.ini.
TagBeep=100:tagbeep@beeps.ini
(Note: If the beeps.ini file or tagbeep section cannot be found, the TagBeep action would default to a single 100ms beep at default frequency, simply ignoring the sequence part of the configuration line.)
This example includes a variety of notes, specified in a variety of different ways. The syntax used is described below.
Key elements in a note sequence:
-
The repeat is a number of times to play the whole sequence, or use forever to continue until another sequence is started.
-
The tempo sets the beats‑per‑minute (defaults to 100).
-
Each note is played in the order listed. Each one is specificed as note=<duration>,<frequency>,<volume>
-
Duration can be specified as number in milliseconds, or as a fraction of a beat, calculated from the tempo setting, denoted by w (whole), h (half), q (quarter), e (eighth) or s (sixteenth). You can have multiple of the fractional units - so 3h would be a duration equivalent to 3 half notes.
-
Frequency can be specified as number in Hz or as a note name such as C#6 where the note here C is named as a letter, # added for sharp or b for flat, and the number refers to the octave, from 0 to 8 (defaults to 6 if omitted).
Setting frequency to 0 switches the buzzer off, which can turn a note into a rest of a specified duration.
-
Volume can be set between 0 and 127, though this is not particularly sensitive (defaults to the maximum 127 if omitted).
-
VTAP can alternatively play very simple MIDI files. It is limited to one channel of a format 0 file, containing a single track. To use a MIDI file, use the section name 'midi' and specify a MIDI file as the file name.
Add these lines to config.txt to call a MIDI file called song.mid.
PassBeep=100:midi@song.mid
This example will play channel 0 of the midi file. Using the section name midi4@ would instead play channel 4 from the named MIDI file. (Note: If the MIDI file cannot be found, the PassBeep action would default to a single 100ms beep at default frequency, simply ignoring the sequence part of the configuration line.)