Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

XMC™ Forum Discussions

RValascho
Employee
Employee
5 questions asked First question asked 10 replies posted
Real simple question, can you show me a working example of an IO004_ReadPin? For whatever reason, I always get a return of '1'.
0 Likes
1 Reply
Not applicable
RValascho wrote:
Real simple question, can you show me a working example of an IO004_ReadPin? For whatever reason, I always get a return of '1'.


#include 			//Declarations from DAVE3 Code Generation (includes SFR declaration)


int main(void)
{
// status_t status; // Declaration of return variable for DAVE3 APIs (toggle comment if required)


DAVE_Init(); // Initialization of DAVE Apps


while(1)
{
if (IO004_ReadPin(IO004_Handle2))
IO004_SetPin(IO004_Handle0);
else
IO004_ResetPin(IO004_Handle0);

if (IO004_ReadPin(IO004_Handle3))
IO004_SetPin(IO004_Handle1);
else
IO004_ResetPin(IO004_Handle1);
}
return 0;
}


373.attach374.attach
0 Likes