Cannot read or write GPIO

Hi,

I am coding a module to check if a door is opened or close.For this purpose, I have pin 1.30 configured as an input and 1.31 as an ouput.

Code from config:

door.door_enable                                true    
door.door_input_pin                                1.30^    
door.door_output_pin                                    1.31

The value of those two pins is always 0.

Here is how I check their values :

THEKERNEL->streams->printf("Pin 0 :%d\n", this->pins[0].get());  //Pin 0 represent the pin 1.30
this->pins[1].set(true);                                                              //Pin 0 represent the pin 1.31
THEKERNEL->streams->printf("Pin 1 :%d\n", this->pins[1].get());

What am I doing wrong?

Thanks in advance for your help!

Nicolas =)

Imported from wikidot

Hey !

Are you sure a switch module is not sufficent to do what you want to do ? What is your module supposed to do.

It’s hard to say what the problem is with so little code, could you push your code to your fork on github, and give us a link ?

Cheers.

Thanks for your response,

I’ll try with the switch module and i’ll get back to you!

Cheers,

Nicolas Gagnon