Example 10 assumes the following technical situation:
An application queries the frequency of an amateur radio receiver (RX) - here in the 20m band - at intervals of 100-ms via a serial interface. A separate transmitter (TX) is to be set to the current RX frequency according to the following approach:
Figure 20.3.3.1.1: Digital frequency display → RX and TX synchronised.
Source code excerpt from the above application (realisation Extended Timer):
Public Sub Form_Open() FMain.Center() FMain.Resizable = False Dial1.MinValue = 14000000 Dial1.MaxValue = 14355000 Dial1.PageStep = 1000 Dial1.Step = 100 Dial1.Value = 14325200 Dial1.Wrap = True LCDLabel.Alignment = Align.Center LCDLabel.Border = True LCDLabel.Background = &HC3DDFF& LCDLabel.Foreground = &H0000FF& SetLEDColor("green") syncTimer.Delay = 1000 End Public Sub Dial1_Change() LCDLabel.Text = Format(Dial1.Value, "00,000000") syncTimer.Stop() syncTimer.Start() SetLEDColor("red") End Public Sub syncTimer_Timer() syncTimer.Stop() SetLEDColor("green") End Public Sub SetLEDColor(sLEDColor As String) PictureBox1.Picture = Picture["LED/led_" & sLEDColor & ".svg"] End Public Sub Form_Close() If syncTimer.Enabled = True Then syncTimer.Stop End
Chapter & Project