anishpsla
Member level 2
- Joined
- Dec 15, 2013
- Messages
- 44
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 8
- Activity points
- 402
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 sbit fan_0 at RB0_bit; void count_rpm(int fan_id) { TMR0=0; Delay_ms(1000); fan_rpm = TMR0*120; if(fan_rpm < 2500) { fan_id = 1; } } void main() { PORTA = 0; PORTB = 0; TRISA = 0X11; TRISB = 0x00; while (1){ count_rpm(fan_0); } }
Which is not working. I think the problem is related to the data type of parameter of count_rpm. sbit as datatype for parameter is allowed in MikroC.
How to set data type for function parameter as pin of a port.