Course : Micro 2 Q) solve the following through micro C coding mikro C: SCENERIO
ID: 2248667 • Letter: C
Question
Course : Micro 2
Q) solve the following through micro C coding mikro C:
SCENERIO :
-Thermistor attached with AN2 of PIC….
-Switch on AC relay attached with pin RC0 of PIC
And switch off HEATER relay attached with RD0 of PIC whenever temp>30 degree celcius
-Switch off AC relay attached with pin RC0 of PIC
And switch on HEATER relay attached with RD0 of PIC whenever temp>25 degree celcius
-Switch on both AC and HEATER relay otherwise
NOTE:Follow the condition and implement a logic code in mikro C
Explanation / Answer
The mikroC PRO for PIC compiler allows you to access individual bits of 8-bit variables by their name or position in the byte:
The mikroC PRO for PIC compiler provides a bit data type that may be used for variable declarations. It cannot be used for argument lists and function-return values.
SBIT TYPE
The mikroC PRO for PIC compiler has an sbit data type which provides access to registers, SFRs, variables, etc. In order to declare a bit of a variable, it is sufficient to write:
1 2 3 INTCON.B0 = 0; ADCON0.F5 = 1; INTCON.GIE = 0;