hallo,
ik heb een brandende vraag, ik heb een programma geschreven met proton picbasic. maar ik vindt het heel erg omslagstig, nu is mijn vraag, kan dit ook eenvoudiger?Ik heb nog weinig verstand van asm, of ontkom ik daar niet aan?
hier is een stuk van mijn programa.
-----------------------------------------------------------'****************************************************************
'* Name : PS2.BAS *
'* Author : Ruud Arkink *
'* Notice : Copyright (c) 2007 Deurningen *
'* : All Rights Reserved *
'* Date : 23-3-2007 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
device 16f876a
CONFIG HS_OSC, WDT_OFF, PWRTE_ON, LVP_OFF
XTAL 20
DECLARE LCD_LINES 4
dim var1 as byte
dim TELLER11 as byte
dim teller9 as byte
dim teller1 as byte
dim TELLER as byte
dim teller3 as byte
dim ARRAY [8] as byte
symbol CLOCK = portb.0
symbol DATABIT = PORTb.1
symbol POWER_LED = porta.0
porta = 00000000
portb = 00000000
trisb = 00000011
trisA = 00000000
clear
cls
teller1 = 1
POWER_LED =1
while 1=1
while clock = 1 : wend
if clock = 0 and databit = 0 then
while clock = 0 :wend
teller = 0
teller3 =1
teller9=1
repeat
WHILE CLOCK = 0 :WEND
while clock = 1 :wend
delayus 25
array [teller]= databit
teller = teller + 1
until teller = 7
delayms 200
endif
if teller1 >= 1 and teller1 <= 20 then
print at 4,1,REP " "\20
if array[0]=1 and array[1]=0 and array [2]=0 and array[3]=1 and array[4]=0 and array[5]=1 and array [6]=0 and array[7]=0 then
print at 3,teller1," "
EWRITE teller1, [032] ;Schrijf de ASCII waarde naar adres
inc teller1 ;spatie
elseif array[0]=0 and array[1]=1 and array [2]=1 and array[3]=0 and array[4]=1 and array[5]=1 and array [6]=1 and array[7]=0 then
print at 3,1, "_ "
while teller >= 1
EWRITE teller1, [000] ;Schrijf de ASCII waarde naar adres
dec teller1
wend
teller1 = 1 ;esc
elseif array[0]=1 and array[1]=0 and array [2]=1 and array[3]=0 and array[4]=1 and array[5]=0 and array [6]=0 and array[7]=0 then
print at 3,teller1,"Q_ "
EWRITE teller1, [081] ;Schrijf de ASCII waarde naar adres
inc teller1
elseif array[0]=1 and array[1]=0 and array [2]=1 and array[3]=1 and array[4]=1 and array[5]=0 and array [6]=0 and array[7]=0 then
print at 3,teller1,"W_ "
EWRITE teller1, [087] ;Schrijf de ASCII waarde naar adres
inc teller1
endif
wend
-----------------------------------------------------------
ik hoop dat iemand me in de goede richting kan wijzen?
ik weet al dat er ook al enkele voorbeelden zijn te vinden op het internet, maar die snap ik niet allemaal even goed.
mvgr. Ruud