Device=16F628A
Config BOREN_OFF, CP_OFF, DATA_CP_OFF, PWRTE_ON, WDT_OFF, LVP_OFF, MCLRE_OFF, XT_OSC, CPD_OFF, WDT_OFF
Xtal=20
All_Digital true
Declare Hserial_Baud=9600
TXSTA.5=1 ' setting Transmit Enable Bit
RCSTA.7=1
RCSTA.4=1
Dim RX As PORTB.1
Dim TX As PORTB.2
'--------------------------------------------'
'Ports that will switch the Relays
Output PORTB.0
Output PORTB.3
Output PORTB.4
Output PORTB.5
Output PORTB.6
'--------------------------------------------'
'Symbol for Ports that will switch the Relays
Symbol led1 PORTB.0
Symbol led2 PORTB.3
Symbol led3 PORTB.4
Symbol led4 PORTB.5
Symbol led5 PORTB.6
Low led1
Low led2
Low led3
Low led4
Low led5
Dim x As Byte
loop:
'x for getting the serial
x = HRSIn
'LED1
If x = "a" Then
Low led1 'Switch ON Relay1 or PortB0 if serial = A
ElseIf x = "b" Then
High led1 'Switch OFF Relay1 or PortB0 if serial = B
EndIf
'LED2
If x = "c" Then
Low led2
ElseIf x = "d" Then
High led2
EndIf
'LED3
If x = "e" Then
Low led3
ElseIf x = "f" Then
High led3
EndIf
'LED4
If x = "g" Then
Low led4
ElseIf x = "h" Then
High led4
EndIf
'LED5
If x = "i" Then
Low led5
ElseIf x = "j" Then
High led5
EndIf
GoTo loop
End
arkadaşlar bu kodlar ile bluetooth üzerinden gönderdiğim a, b , c verileri ile ledleri kontrol etmeyi planlıyorum.
elimde şuan hc-06 yok ama masaüstü bilgisayarımda kullandığım usb türü bluetooth adaptörüm var bunu modifiye ederek kullanabilir miyim acaba?
sipariş ettim türkiye de pahalı diye çinden gelmesini bekleyeceğim..
bu kodları isis ile simüle edebilir miyim? edebilirsen nasıl yapabilirm az biraz açıklayabilirseniz sevinirim.