digital inputs and outputs RPI [message #1753996] |
Mon, 13 February 2017 12:36  |
Eclipse User |
|
|
|
Hello
Sorry for my english
I want to create new function blocks to control the digital inputs and outputs of the raspberry, when creating a function block I can use the digital inputs and outputs, but when I create two fb one to declare the input pins and another to execute the process does not work, I do not know if I'm programming wrong or maybe I should also schedule the events.
Attached my code,
Thank you
Gustavo
*******1 fb******
case scm_nEventINITID:
wiringPiSetup();
pinMode (2, INPUT);
while(1)
{
if (digitalRead(2)==0)
{VALUE1() = true;}
else {VALUE1()=false ;}
}
sendOutputEvent(scm_nEventINITOID);
break;
+++++++2 Fb++++++++++
case scm_nEventINITID:
wiringPiSetup();
pinMode (0, OUTPUT);
while(1)
{
if (true== VALUE2())
{digitalWrite(0,HIGH);}
else {digitalWrite(0,LOW);}
}
break;
.............................
Attachment: PRUEB2.fbt
(Size: 5.28KB, Downloaded 177 times)
Attachment: PRUEB1.fbt
(Size: 5.28KB, Downloaded 164 times)
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.09249 seconds