Hi,
Am using the code below to simply read from a sensor on PortA,2 then move to another sensor on PortA,3
The first sensor is read fine, but the second sensor which should have been redefined to PortA,3 is still being read from PortA,2 .
Have used debugger etc but nothing I look at can show me that the undefine and define to PortA,3 has actually worked.
Is there something that does show the defines ? or have I coded them incorrectly ?
thanks
Am using the code below to simply read from a sensor on PortA,2 then move to another sensor on PortA,3
The first sensor is read fine, but the second sensor which should have been redefined to PortA,3 is still being read from PortA,2 .
Have used debugger etc but nothing I look at can show me that the undefine and define to PortA,3 has actually worked.
Is there something that does show the defines ? or have I coded them incorrectly ?
thanks
Code:
#define DS18PORT PORTA, 2 ; set up for sensor1 on portA 2
#define DS18TRIS TRISA, 2
call DS18B20_convert
; more main loop code etc
#undefine DS18PORT ; set up for sensor2 on portA,3
#undefine DS18TRIS
#define DS18PORT PORTA, 3
#define DS18TRIS TRISA, 3
call DS18B20_convert
; more main loop code etc
#undefine DS18PORT ; restore ports for sensor1
#undefine DS18TRIS
#define DS18PORT PORTA, 2
#define DS18TRIS TRISA, 2
; go to start of main loop