Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' {$STAMP BS2}
- ' {$PBASIC 2.5}
- loopTeller VAR Word
- maaleVerdi VAR Byte
- adressePeker VAR Byte
- ledstatus VAR Word
- ledloop VAR Word
- knappclear PIN 0
- ledstatus = 0 'Statusen på leden
- DO
- IF (IN12=1) THEN
- PAUSE 250
- IF(IN12=1) THEN
- PAUSE 250
- IF(IN12=1) THEN
- PAUSE 250
- IF(IN12=1) THEN
- PAUSE 250
- IF(IN12=1) THEN
- GOTO clear_memory
- ENDIF
- ENDIF
- ENDIF
- ENDIF
- DEBUG "Sender måledata", CR
- FOR ledloop = 1 TO 6 'antall ledden skal blinke*2
- IF (ledstatus=0) THEN 'sjekker om leden lyser
- HIGH 14
- ledstatus = 1
- PAUSE 300
- ELSEIF (ledstatus=1) THEN 'sjkker om ledden ikke lyser
- LOW 14
- ledstatus = 0
- PAUSE 300
- ENDIF
- NEXT
- DEBUG "nr, verdi", CR
- adressePeker = 0
- FOR loopTeller = 1 TO 50
- READ adressePeker, maaleVerdi
- DEBUG DEC loopTeller, ", ", DEC maaleverdi, CR
- WRITE adressePeker, maaleVerdi
- adressePeker=adressePeker + 2
- NEXT
- ENDIF
- IF (IN9=1)THEN
- PAUSE 300
- DEBUG "Måler..", CR
- adressePeker = 0
- FOR loopTeller = 1 TO 50
- PULSIN 1, 1, maaleVerdi
- DEBUG DEC4 ? maaleVerdi
- FREQOUT 14, 25, maaleVerdi
- WRITE adressePeker, Word maaleVerdi
- adressePeker = adressePeker + 2
- NEXT
- ENDIF
- LOOP
- clear_memory:
- DEBUG "Tømmer minnet..", CR
- adressePeker = 0
- maaleVerdi = 0
- FOR loopTeller = 1 TO 50
- maaleVerdi = 0
- WRITE adressePeker, Word maaleVerdi
- adressePeker = adressePeker + 2
- NEXT
- DEBUG "FERDIG TØMMT", CR
- RETURN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement