Here's fixed code. Besides code, you need also 10k pulldown resistors from transistor bases to GND.
Code:;----[12F683 Hardware Configuration]-------------------------------------------- #IF __PROCESSOR__ = "12F683" #DEFINE MCU_FOUND 1 #CONFIG cfg = _INTOSCIO ; INTOSCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN cfg&= _WDT_OFF ; WDT disabled cfg&= _PWRTE_OFF ; PWRT disabled cfg&= _MCLRE_OFF ; MCLR pin function is digital input, MCLR internally tied to VDD cfg&= _CP_OFF ; Program memory code protection is disabled cfg&= _CPD_OFF ; Data memory code protection is disabled cfg&= _BOD_OFF ; BOR disabled cfg&= _IESO_ON ; Internal External Switchover mode is enabled cfg&= _FCMEN_ON ; Fail-Safe Clock Monitor is enabled __CONFIG cfg #ENDCONFIG #ENDIF ;----[Verify Configs have been specified for Selected Processor]---------------- ; Note: Only include this routine once, after all #CONFIG blocks #IFNDEF MCU_FOUND #ERROR "No CONFIGs found for [" + __PROCESSOR__ +"]" #ENDIF ANSEL = %00000000 'disable analog CMCON0 = 7 'disable comparators TRISIO=%00001000 'input config OSCCON = %01110111 'Include "Modedefs.bas" Define OSC 8 ' Set Xtal Frequency ' Clk Var GPIO.5 ' Data is clocked on rising edge of this pin kviteli ' Dta Var GPIO.4 ' Bits are shifted out of this pin stafilosferi ZERO var GPIO.0 ONE VAR GPIO.4 TWO VAR GPIO.1 TRE VAR GPIO.2 cik var byte 'loop variable x var byte 'delay variable increment var byte 'incremental variable lop var byte 'also variable increment=0 'temp sub var byte 'intracounter variable sub=9 x=22 '22 x and 295 y for 30 second loop y var word 'showdelay 44 and 590 for 1 minute loop y=295 pause 500 'INIT tube and reset to 0 'x=2000 inika: LOW ONE LOW TWO LOW TRE HIGH ZERO PAUSE x high one LOW ZERO pause x high two low one pause x high tre low two pause x high zero low tre pause x low zero koka: if GPIO.3=0 THEN low tre low two low one high zero pause x low zero goto tavi ENDIF pause 1 GOTO KOKA tavi: 'stage 1______________________________________________ 'high zero 'pause x 'low zero sub=9 gosub sub9 high one 'proper finish? one and two pause x low one high two pause x low two high zero Pause Y'delay for display low zero sta2: 'stage 2 ______________________________________________ gosub sub9 gosub subzero Pause Y low one 'stage 3____________________________________________ gosub sub9 gosub subzero pause x high two low one Pause Y high tre low two pause x low tre 'stage 4____________________________________________ sub=8 gosub sub9 gosub subzero gosub sub2 Pause Y low tre 'stage 5____________________________________________ gosub sub9 gosub subzero gosub sub2 pause x high one low tre Pause Y low one 'stage 6____________________________________________ gosub sub9 gosub subzero gosub sub2 pause x high one low tre pause x high two low one Pause Y high tre low two 'stage 7____________________________________________ pause x low tre sub=7 gosub sub9 gosub subzero gosub sub2 pause x high one low tre pause x high two low one pause x high tre low two Pause Y low tre 'stage 8____________________________________________ gosub sub9 gosub subzero gosub sub2 pause x high one low tre pause x high two low one pause x high tre low two pause x high one low tre Pause Y low one 'stage 9____________________________________________ 'X=100 gosub sub9 gosub subzero gosub sub2 pause x high one low tre pause x high two low one pause x high tre low two pause x high one low tre pause x high two low one Pause Y high tre low two pause x 'stage 10____________________________________________ low tre sub=6 gosub sub9 gosub subzero gosub sub2 pause x high one low tre pause x high two low one pause x high tre low two pause x high one low tre pause x high two low one pause x high tre low two Pause Y low tre 'stage 11____________________________________________ low tre sub=6 gosub sub9 gosub subzero pause x high two low one pause x high tre low two pause x gosub sub1 high one low tre Pause Y low ONE 'stage 12____________________________________________ low tre sub=6 gosub sub9 gosub subzero pause x high two low one pause x high tre low two pause x gosub sub1 high one low tre pause x high two low ONE Pause Y low two 'stage 13____________________________________________ high tre pause x low tre sub=5 gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre pause x high two low ONE pause x high tre low two Pause Y low tre 'stage 14____________________________________________ sub=5 gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre pause x high two low ONE pause x high tre low two pause x high one low tre Pause Y low one 'stage 15____________________________________________ sub=5 gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre gosub sub2 pause x high one low tre pause x high two low one Pause Y low two 'stage 16____________________________________________ high tre pause x low tre sub=4 gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre gosub sub2 pause x high one low tre pause x high two low one pause x high tre low two Pause Y low tre 'stage 17____________________________________________ sub=4 gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre gosub sub2 pause x high one low tre pause x high two low one pause x high tre low two pause x high one low tre Pause Y low one 'stage 18____________________________________________ sub=4 gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre gosub sub2 pause x high one low tre pause x high two low one pause x high tre low two pause x high one low tre pause x high two low one Pause Y low two 'stage 19____________________________________________ high tre pause x low tre sub=3 gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre gosub sub2 pause x high one low tre pause x high two low one pause x high tre low two pause x high one low tre pause x high two low one pause x high tre low two Pause Y low tre 'stage 20____________________________________________ sub=3 gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre gosub sub2 pause x high one low tre pause x high two low one pause x high tre low two pause x high one low tre pause x high two low one pause x high tre low two pause x high one low tre Pause Y low one 'stage 21____________________________________________ sub=3 gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre gosub sub2 pause x gosub sub1 high one low tre pause X high two low one Pause Y low two 'stage 22____________________________________________ high tre pause x low tre sub=2 gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre gosub sub2 pause x gosub sub1 high one low tre pause X high two low one pause x high tre low two Pause Y low tre 'stage 23____________________________________________ sub=2 gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre gosub sub2 pause x gosub sub1 high one low tre gosub sub2 pause X high one low tre Pause Y low one 'stage 24____________________________________________ sub=2 gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre gosub sub2 pause x gosub sub1 high one low tre gosub sub2 pause X high one low tre pause X high two low one Pause Y low two 'stage 25____________________________________________ high tre pause x low tre sub=1 gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre gosub sub2 pause x gosub sub1 high one low tre gosub sub2 pause X high one low tre pause X high two low one pause x high tre low two Pause Y low tre 'stage 26____________________________________________ sub=1 gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre gosub sub2 pause x gosub sub1 gosub sub1 high one low tre Pause Y low one 'stage 27____________________________________________ sub=1 gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre gosub sub2 pause x gosub sub1 gosub sub1 high one low tre pause x high two low one Pause Y low two 'stage 28____________________________________________ high tre pause x low tre 'sub=1 'gosub sub9 gosub subzero gosub sub2 pause x '----- gosub sub1 '------ high one low tre gosub sub2 pause x gosub sub1 gosub sub1 high one low tre pause x high two low one pause x high tre low two Pause Y low tre 'x=400 'stage 29____________________________________________ high one pause x high two low one pause x high zero low two pause x low zero sub=9 gosub sub9 high one Pause Y low one 'x=400 'stage 30____________________________________________ high two pause x high zero low two pause x low zero sub=9 gosub sub9 high one pause x high two low one Pause Y low two 'stage 31____________________________________________ high zero pause x low zero sub=9 gosub sub9 high one 'proper finish? one and two pause x low one high two pause x low two high zero Pause Y 'low zero goto koka sub9: 'subroutine for spinning for cik=1 to sub 'amount needed for full loop high one pause x high two low one pause x high tre low two pause x low tre next return subzero: high one 'proper finish? one and two pause x high two low one pause x high zero low two pause x'delay for display high one low zero 'subzero here return sub1: 'smaller sub high one low tre pause x high two low one pause x high tre low two pause x high one low tre pause x high two low one pause x high tre low two pause x return sub2: 'even smaller sub pause x high two low one pause x high tre low two return




Bookmarks