Hi ! I try to build one wired remote for HU Pioneer , using remote control stalk near the steering wheel, from Renault. I wrote the code ; in simulation work fine. But...I don't know how setting ports "b" and what to do when push_button it's press.
In "original" remote, the command are given by putting resistors "to ground". How can I do this with my PIC ? Thanks in advance !
Code:
@ DEVICE pic16F628A, INTRC_OSC, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON, LVP_OFF, CPD_OFF, PROTECT_OFF
Include "modedefs.bas" ' Serial Protocol
Define OSC 4 ' 4MHz
CMCON = 7 ' Disable on-chip comparator, PORTA in digital mode
'// Define port pins as inputs and outputs ...
TRISA = %00000111
TRISB = %11111100
portb = 1
include "c:\pbp\keypad2.pbp" ' see http://www.picbasic.co.uk/forum/showthread.php?t=3250
main:
gosub keypadscan
gosub check
goto main
check:
select case key
case 1 ; volume down
trisb.2=0 ; ?????
pause 200 ;
trisb.2=1 ' ?????
Bookmarks