7ezhil7
Junior Member level 2
I am doing a project in PIC16f877a with 2 DHT11 sensors.The sensors where placed at different places.But the code for both of the sensors were same.I would like to reuse the code.I dont know how to do that...
I tried above code but i shoots an error as 'undefined locpin'.
Please suggest me a way to reuse my code.
Code:
#define dht11pin locpin;
#define dht11dir locdir;
........
........
void main()
{
locpin=PORTAbits.RA0;
locdir =TRISAbits.TRISCA0;
}
I tried above code but i shoots an error as 'undefined locpin'.
Please suggest me a way to reuse my code.