Hi,
I've never needed to use the Digital IN/OUT simulataneously before so this might also be a question disguised as an answer, but I would like to clarify it even though your having a read issue.
In your main loop, at first you call,
ir_rx0.output(); You set the pin register as output
ect....
then set the value,
ir_rx0 = 1; Set Pin High
ect...
then you move on and set the pin register to input,
ir_rx0.input();
ect...
then you go on to reference the value of those pins,
if((ir_rx0==0) & ir_set[0])
{
ir_set[0]=false; ir_value[0]=i;
}
My thought is if you are referencing the Pin register value directly, wouldn't you need a,
if_rx0.read() call value of pin
if((ir_rx0.read()==0) & ir_set[0])
{
ir_set[0]=false; ir_value[0]=i;
}
if it was a variable then you could write eg..,
int ir_rx0a;
ir_rx0a = ir_rx0.read();
if((ir_rx0a==0) & ir_set[0])
{
ir_set[0]=false; ir_value[0]=i;
}
Is this correct? or can you just write the pin object name directly into the if statement when reading it?
Hi
I am just working on line follower using LPC1768 and I have problem with driving a motor and at the same time reading sensors. With my implementation, it seems that while motors are running, reading from sensors do not change. On the other when I only implement reading sensors they work fine. Here is my code could you tell me what could be a problem. Many thanks!