Hi, everyone.
I have just started using embedded c (in keil c compiler).I have used Arduino in the past. Whenever we want to know the current status of the input pins in Arduino,we code something like,
int pin1=8;
void setup()
{
PinMode(pin1,INPUT);
}
void loop()
{
int x;
x=digitalRead(pin1); reading current state of pin1(8)
}
My question is what is the analogus for 'digitalRead' in embedded c?
I have heard that we have to initialize all input ports to 1 . Is it true?
Also,is it something like input pins automatically get updated in embedded c type programming?
Please ,help me how to use inputs in c prog.
Give a sample code for regular reading of input pins in embedded c.
thanks..
I have just started using embedded c (in keil c compiler).I have used Arduino in the past. Whenever we want to know the current status of the input pins in Arduino,we code something like,
int pin1=8;
void setup()
{
PinMode(pin1,INPUT);
}
void loop()
{
int x;
x=digitalRead(pin1); reading current state of pin1(8)
}
My question is what is the analogus for 'digitalRead' in embedded c?
I have heard that we have to initialize all input ports to 1 . Is it true?
Also,is it something like input pins automatically get updated in embedded c type programming?
Please ,help me how to use inputs in c prog.
Give a sample code for regular reading of input pins in embedded c.
thanks..
Last edited: