ja genau, das hab ich ,.
stimmt ja ,. bin heut nich so fit kanns natürlich wenns separiert ist auch ohne fb funktionen testen!
stimmt ja ,. bin heut nich so fit kanns natürlich wenns separiert ist auch ohne fb funktionen testen!
$crystal = 16000000
$regfile = "m8def.dat"
$hwstack = 32 ' default use 32 for the hardware stack
$swstack = 10 'default use 10 for the SW stack
$framesize = 40 'default use 40 for the frame space
$baud = 19200
'Portconfiguration-------------------------------------------------------------
Config Portd.2 = Input
Taster1 Alias Portd.2
'Portd.2 = 1
Config Portd.3 = Input
Taster2 Alias Portd.3
'Portd.3 = 1
'>Save&Load
Dim Poweron As Byte
Enable Interrupts
On Int0 Poweron_isr
Enable Int0
Config Int0 = Change
Poweron = 1
Print Version(1)
Do
Loop
End
Poweron_isr:
Print "Taster1 " ; Taster1
' And Poweron = 1
If Poweron = 1 Then
'Gosub speichern
Poweron = 0
Print "schlafen gehen"
'Mcucr.isc01 = 1
'Mcucr.isc11 = 1 'umschalten von Falling auf Low Level
Power Powersave
Elseif Poweron = 0 Then
' 'Gosub laden
Poweron = 1
'Mcucr.isc01 = 0
'Mcucr.isc11 = 0 'umschalten von Low Level auf Falling
Print "wurde angeschaltet" 'wieder schlafen gehen
End If
Return
$crystal = 16000000
$regfile = "m8def.dat"
$hwstack = 32 ' default use 32 for the hardware stack
$swstack = 10 'default use 10 for the SW stack
$framesize = 40 'default use 40 for the frame space
$baud = 19200
'Portconfiguration-------------------------------------------------------------
'Config Pind.2 = Input
'Portd.2 = 0
Dim Poweron As Byte
Enable Int0
Config Int0 = Rising
On Int0 Poweron_isr:
Enable Interrupts
Poweron = 1
Print "Booting..."
Print Version(1)
Do
Print "poweron " ; Poweron
Loop
End
Poweron_isr: ' wird nur bei tastendruck aufgerufen ' And Poweron = 1
If Poweron = 1 Then
'Gosub speichern
Poweron = 0
Print "schlafen gehen"
'Power
Power Powersave
Elseif Poweron = 0 Then
'Gosub laden
Poweron = 1
Print "wurde angeschaltet" 'wieder schlafen gehen
End If
Return
Fb_auswertung:
If Ausgabe_flag = 1 Then
Ausgabe_flag = 0
Toggle Statusled 'empfang anzeign
' Print "Anzahl Flanken: " ; Flanken_index
' For I = 1 To Flanken_index
' Print " " ; Flanken_array(i);
' Next I
' Print ""
If Flanken_index = 68 Then '68impulse erkannt
For I = 5 To 67 Step 2
If Flanken_array(i) < 1000 Then
Shift Ausgabe , Left
Elseif Flanken_array(i) > 1000 And Flanken_array(i) < 4000 Then
Shift Ausgabe , Left
Ausgabe.0 = 1
End If
Next I
Adresse_negiert = Not Adresse_negiert
Befehl_negiert = Not Befehl_negiert
If Adresse = Adresse_negiert And Befehl = Befehl_negiert Then
Print "Empfang ok: Befehl=" ; Adresse ; "(" ; Bin(adresse) ; ")";
End If
Elseif Flanken_index = 4 Then '4 impulse erkannt
For I = 0 To 3
If Flanken_array(i) < 1000 Then
Shift Ausgabe , Left '3xlang, 1xkurzer puls = signal wird gehalten
Ausgabe.0 = 0
Elseif Flanken_array(i) > 1000 Then
Shift Ausgabe , Left
Ausgabe.0 = 1
End If
Next I
If Ausgabe >= 14 Then 'überprüfen ob signalfolge eingehalten wurde
Print "Taste wird gehalten "
Adresse = Adresse_alt 'vorher gedrueckte taste wieder aufrufen
End If
Else
'Print "nix genaues erkannt"
End If
Flanken_index = 400
Timer1 = 0
Start Timer1
If Gifr.intf0 = 0 Then
Enable Int0 'falls zwischenzeitlich kein INT0 aufgetreten ist
End If
Tastetnauswertung programm 1-4
adresse=adresse_alt
adressse=0