Raambediening Update

Ik heb besloten om de pcb layout en de code ook vrij te geven.

De layout van V2.1:
Printplaat V2_1Printplaat V2_1

De layout van V2.2:
Printplaat V2_2
Printplaat V2_2

In deze layouts zitten nog fouten dus even vergelijken met het schema en corrigeren als je dit wil nabouwen. Als er intresse is kan ik wel even een nieuw printplaat tekenen.

 

De code:

'****************************************************************
'*  Name    : Comfortconsole.BAS                                *
'*  Author  : [Stynus]                                          *
'*  Notice  : Copyright (c) 2008 [www.elektronicastynus.be]     *
'*          : All Rights Reserved                               *
'*  Date    : 14/02/2008                                        *
'*  Version : 4.1                                               *
'*  Notes   : Comfortconsole                                    *
'****************************************************************
    Device 12F629
    Config INTRC_OSC_NOCLKOUT, WDT_OFF, PWRTE_ON, MCLRE_ON, CP_ON
    ALL_DIGITAL     TRUE
    
    Dim tellerlaag  As Byte
    Dim tellerhoog  As Byte
    Dim ICounter    As Byte
    Clear
    
    Symbol stroomSensor = PORTB.0
    Symbol knopOmhoog   = PORTB.4
    Symbol knopOmlaag   = PORTB.5
    Symbol UitR         = PORTB.2
    Symbol UitL         = PORTB.1
    
    Low UitR
    Low UitL
   
Main:
    While 1 = 1
        If knopOmhoog = 0 And knopOmlaag = 1 And stroomSensor = 0 Then
            GoSub Omhoog
        EndIf
        If knopOmlaag = 0 And knopOmhoog = 1 And stroomSensor = 0 Then
            GoSub Omlaag
        EndIf
    Wend

Omhoog:
    Low UitL
    High UitR 
    DelayMS 500
    While 1 = 1 
        If knopOmlaag = 0  Or stroomSensor = 1 Then
            Low UitR
            GoTo wachten
        EndIf 
    Wend

Omlaag:
    Low UitR
    High UitL 
    DelayMS 500
    While 1 = 1 
        If knopOmhoog = 0  Or stroomSensor = 1 Then 
            Low UitL
            GoTo wachten
        EndIf 
    Wend

wachten:
    DelayMS 1000
    Return
    
End      

Geef een reactie

Je e-mailadres wordt niet gepubliceerd.

Deze site gebruikt Akismet om spam te verminderen. Bekijk hoe je reactie-gegevens worden verwerkt.