7ezhil7
Junior Member level 2
- Joined
- Mar 31, 2016
- Messages
- 20
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 214
Hi,
I am trying to reuse a code for different pins in pic16f877a.For that i have use structure concept in C.I haven't completed my program.As I was a begginer to structures concept I compiled it for any syntax errors.I got [illegal conversion between types int -> struct DHT11] error.
I would like to know why this error arises also whether my method to reuse code for different pins would work or not.
THANKS IN ADVANCE.
I am trying to reuse a code for different pins in pic16f877a.For that i have use structure concept in C.I haven't completed my program.As I was a begginer to structures concept I compiled it for any syntax errors.I got [illegal conversion between types int -> struct DHT11] error.
Code:
#define _XTAL_FREQ 10000000
#include<htc.h>
#include<stdio.h>
struct DHT11
{
unsigned char pin;
volatile unsigned char *port;
volatile unsigned char *tris;
}
checkhigh(struct DHT11 *POS)
{
char say = 0; //waitforhigh
while(!POS->pin) {
say++;
__delay_us(1);
if(say > 100)return 0;
}
void main()
{
struct DHT11 OUT;
OUT.pin = 0;
OUT.port = &PORTA;
OUT.tris = &TRISA;
}
I would like to know why this error arises also whether my method to reuse code for different pins would work or not.
THANKS IN ADVANCE.