Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
Delay( 1000)
tone( 6 , 500, 500)
Delay( 100)
tone( 6 , 750, 500)
Delay( 100)
tone( 6 , 1000, 500)
Delay( 100)
tone( 6 , 1500, 500)
End Sub
Sub tone(Pin As Byte, freq As Int, duration As ULong)
Dim sound As Pin
sound.Initialize(Pin,sound.MODE_OUTPUT)
Dim d As ULong = 500000/freq
Dim tnow As ULong = Micros
Do While Micros - tnow < duration * 1000
sound.digitalWrite(True)
DelayMicroseconds(d)
sound.digitalWrite(False)
DelayMicroseconds(d)
Loop
End Sub