Jump to content
ELFORUM - Forumul electronistilor

cod bascom problema


script22
 Share

Recommended Posts

care ma ajuta cu codu asta

nu imi incrementeaza lightt si releut.

 

' * - - * - * * - - - - - - - - - - - - - - - - - - - - - - - - - - -'Made by script22'v4'' * - - * - * * - - - - - - - - - - - - - - - - - - - - - - - - - -$regfile = "m8def.dat"$crystal = 8000000'$sim'$lib "lcd4.lbx"Declare Sub Lover_text()Declare Sub SetclockConfig Pind.0 = InputConfig Pind.1 = InputConfig Pind.2 = InputConfig Pind.3 = InputConfig Pind.4 = InputConfig Pinb.1 = OutputConfig Pinb.2 = OutputConfig Pinb.0 = InputDim C As ByteDim D As ByteDim E As ByteDim Releu As BitDim Light As BitDim Releut As IntegerDim Lightt As IntegerPortd.0 = 1Portd.1 = 1Portd.2 = 1Portd.3 = 1Portd.4 = 1Portb.1 = 0Portb.2 = 0Portb.0 = 1C = 0D = 0E = 0Releut = 0Lightt = 0Dim B As ByteDim A As IntegerDim Secounds As ByteDim Minutes As ByteDim Hours As ByteLet Secounds = 0Let Minutes = 0Let Hours = 0Let A = 0Reset Portb.2Reset Portb.1Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.2 , Db6 = Portc.1 , Db7 = Portc.0 , Rs = Portc.5 , E = Portc.4Config Lcd = 16 * 2Deflcdchar 0 , 32 , 21 , 14 , 4 , 4 , 10 , 17 , 17          ' replace ? with number (0-7)Deflcdchar 1 , 32 , 4 , 14 , 14 , 14 , 4 , 4 , 4            ' replace ? with number (0-7)Set Portb.1ClsLcd " http://www.elforum.info "LowerlineLcd "Code by script22"Wait 3Reset Portb.1Config Timer1 = Timer , Prescale = 1024On Ovf1 Tim1_isrLoad Timer1 , 7812Setclock:Disable InterruptsLet Secounds = 0ClsCursor On BlinkLcd "Time: "LowerlineLcd "Set Clock!"Locate 1 , 9Lcd ":"Locate 1 , 12Lcd "."Do  If Pind.1 = 0 Then      Minutes = Minutes + 1      If Minutes = 60 Then Minutes = 0      Waitms 200   End If   If Pind.0 = 0 Then      Hours = Hours + 1      If Hours = 24 Then Hours = 0      Waitms 200   End If   If Pind.2 = 0 Then Exit Do   Locate 1 , 7   Lcd "  "   Locate 1 , 7   Lcd Hours   Locate 1 , 10   Lcd "  "   Locate 1 , 10   Lcd Minutes   Locate 1 , 13   Lcd "  "   Locate 1 , 13   Lcd Secounds   Waitms 50   If Pind.4 = 0 Then  Waitms 3  Light = 1  End If  If Pinb.0 = 0 Then  Waitms 3  Releu = 1  D = D + 1  End If   LoopEnable Timer1Enable InterruptsCursor Off NoblinkCall Lover_text()Do  If Pind.4 = 0 Then  Waitms 3  Light = 1  End If  If Pinb.0 = 0 Then  Waitms 3  Releu = 1  D = D + 1  End If  LoopTim1_isr:   Load Timer1 , 7812   If Secounds = 60 Then      Secounds = 0      Minutes = Minutes + 1      If Minutes = 60 Then         Minutes = 0         Locate 1 , 10         Lcd "  "         Hours = Hours + 1         If Hours = 24 Then            Hours = 0            Locate 1 , 7            Lcd "  "            Call Lover_text()            nop            nop         End If      End If   End If   Locate 1 , 7   Lcd Hours   Locate 1 , 10   Lcd Minutes   Locate 1 , 13   Lcd "  "   Locate 1 , 13   Lcd Secounds   Locate 1 , 16   If A = 0 Then      Lcd Chr(0)      A = 1   Elseif A = 1 Then      Lcd Chr(1)      A = 0   End If   Secounds = Secounds + 1   If Light = 1 Then   Set Portb.1   Lightt = Lightt + 1   Light = 0   End If   If Lightt = 240 Then   Reset Portb.1   End If   If Releu = 1 Then   Set Portb.2   Releut = Releut + 1   End If   If Releut = 300 Then   Reset Portb.2   Releu = 0   End If   ReturnEndSub Lover_text()   Locate 2 , 0   Lcd "   <<- " ; D ; " ->>  "End Sub
Link to comment
Share on other sites

cand nu vrei sa gresesti atunci gresesti mai tare ori cum sunt la inceput si mereu ma blochez cand vreau sa fac un program acm lam terminat avaem mai multe gresesti trebuia sa resetez releut si lightt la final pentru a merge a 2a oara.ms mult pentru sustinere a in semnat mult.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines