; CONFIGURATION Device 16F628A ; 16F628A PIC Microcontroller Config INTRC_OSC_NOCLKOUT, WDT_OFF, PWRTE_ON, LVP_OFF, MCLRE_OFF All_Digital TRUE ; All inputs digital PortB_Pullups On ; On-chip pull-up weerstanden actief op poortB CCP1_Pin PORTB.3 ; Hardware pwm pin portb.3 = pin9 on chip Symbol AUDIO = PORTA.0 ; Poort A.0 is de Audio Uitgang te gebruiken bij sound, freqout instructies Symbol S1 = PORTB.0 ; Drukknop om te starten, pull_ups zijn ingeschakeld dus ingang 0V voor start TRISA = %00000000 ; PoortA = output TRISB = %11110111 ; poortB = input , pwm_pin = output 9 Clear ; Wis geheugen START: If S1 = 0 Then HPWM 1, 127, 1000 ; channel 1 , duty 50, 1kHz(1000Hz) GoTo START