Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim Speaker As PORTA.3
Dim SpeakerTris As TRISA.3
Dim Speaker As PORT[COLOR="red"]B[/COLOR].3
Dim SpeakerTris As TRIS[COLOR="Red"]B[/COLOR].3
While(TRUE) //repeat forever
toggle (portb.0)
delayms (250)
If PORTB.0=0 Then //if button 1 pressed
For i = 1 To 10 //play 10 tones
Tone=Rand(5) //each tone is random frequency
DelayMS(250) //and for 0.25 seconds
Next //end for loop
Else //otherwise
Tone=5 //silence
i=Rand(255) //make rand more random
EndIf //end if condition
Wend //end of while loop
End
, hit F10 and now it works
not very loud
perhaps adding an amp??
I don't have a junebug I was using my pickit2 and a 18f1220 with a speaker@Burt,
No need to add a toggle, just press button 1 to hear the awful sound.
For i = 1 To 10 //play 10 tones
DelayMS(250) //and for 0.25 seconds