milanino
Member level 2
- Joined
- Mar 5, 2013
- Messages
- 51
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,602
you locked the keypad and you press a number the number will bil tansmitted with le line 220v to the receiver it compares the number to the position of the dip switch and it activate the relay
but not the code will be transmited only the number pressed after you have locked the keypad
for exemple
the code of locking the keypad is 1234.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 For Transmitter void main() { UART1_Init(9600); // Initialize UART module at 9600 bps Delay_ms(100); // Wait for UART module to stabilize while (1) { // Endless loop UART1_Write_Text(keycode); // and send data via UART } } For Receiver char uart_rd; void main() { UART1_Init(9600); // Initialize UART module at 9600 bps Delay_ms(100); // Wait for UART module to stabilize while (1) { // Endless loop if (UART1_Data_Ready()) { // If data is received, UART_Read_Text(uart_rd, "99", 8); // reads text until 'OK' is found } } } You should sent code like 12345699. Code is 6 characters and delimiter is 2 characters.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 unsigned int ikeycode = 0; unsigned int imemkeycode = 0; void main() { while(1) { if(ikeycode <> 0) { imemkeycode = eeprom_read(addr); temp = eeprom_read(addr++) * 100; imemkeycode = imemkeycode + temp; if(ikeycode == imemkeycode) { //LCD Code } } } }
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?