Forum Stats

  • 3,852,223 Users
  • 2,264,080 Discussions
  • 7,905,005 Comments

Discussions

GPIO Sample SDK 8.2 ME - Listener not working

HarrySatt
HarrySatt Member Posts: 26
edited Jan 7, 2016 11:32AM in Java ME SDK

Hi

Someone out there who got the GPIO sample in SDK 8.2 ME working with the Raspberry Pi. For me only LED output works after coming around some curious pin assigments between SDK and RPi.

Now I have my program compiled and starting correct but the listener is not called if I alter the voltage level on the corresponding RPi pin.

I read

The trigger modes TRIGGER_HIGH_LEVEL, TRIGGER_LOW_LEVEL, and TRIGGER_BOTH_LEVELS are not supported on the Raspberry Pi.

But the triggers are set to by the default TRIGGER_BOTH_EDGES

1GPIO4GPIO 4controllerNumber = 0

pinNumber = 4

direction = GPIOPinConfig.DIR_INPUT_ONLY

mode = DeviceConfig.DEFAULT

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue - ignored

Is this the reason for not reacting listeners.

Regards, harald

Best Answer

  • HarrySatt
    HarrySatt Member Posts: 26
    edited Jan 7, 2016 11:32AM Answer ✓

    Sorry. Solved that. It is correct. The RPi is not able to work with the predefined TRIGGER properties. so I used

    button.setTrigger(GPIOPinConfig.TRIGGER_BOTH_EDGES)

    and the RPi is calling the listener. Fine.

    Regards, harald

Answers

  • HarrySatt
    HarrySatt Member Posts: 26
    edited Jan 7, 2016 11:32AM Answer ✓

    Sorry. Solved that. It is correct. The RPi is not able to work with the predefined TRIGGER properties. so I used

    button.setTrigger(GPIOPinConfig.TRIGGER_BOTH_EDGES)

    and the RPi is calling the listener. Fine.

    Regards, harald

This discussion has been closed.