Generate distinctive handlers for Pin.FALLING & Pin.RISING .. is this possible ?



  • Good Morning everyone.
    Using Pin handlers, i'm expecting to launch specific handlers for Pin.FALLING & Pin.RISING..
    Is this possible to perform ?
    Something like :
    Wire1.callback(trigger = Pin.IRQ_RISING, handler=Wire1_Handler_Rising)
    Wire1.callback(trigger = Pin.IRQ_FALLING, handler=Wire1_Handler_Falling)
    Is this the good way to proceed ?
    Thanks in advance for your help
    Regards
    Patrick.



  • @iosman123 said in Generate distinctive handlers for Pin.FALLING & Pin.RISING .. is this possible ?:

    I have a non PSM related problem with a continuously attached/connected GPY with 43818 modem firmware. I get the socket problem OSError: [Errno 118] EHOSTUNREACH if I haven't contacted to the server for more than about half a minute. I find the only way to fix this is to disconnect then reconnect the modem. Wondering why deinit(detach=False,reset=False) does not work in this situation? Thanks

    thanks my issue has been fixed.



  • @iosman123 You should probably post this as a new thread. This seems quite unrelated to the thread you posted to.



  • I have a non PSM related problem with a continuously attached/connected GPY with 43818 modem firmware. I get the socket problem OSError: [Errno 118] EHOSTUNREACH if I haven't contacted to the server for more than about half a minute. I find the only way to fix this is to disconnect then reconnect the modem. Wondering why deinit(detach=False,reset=False) does not work in this situation? Thanks



  • @pevrard I believe calling callback twice will just replace the previous callback. You can have both RISING and FALLING in the same trigger by ORing them, but I don't believe you can have separate handlers.

    You may try to instantiate two different Pin objects, but I doubt this will work.


Log in to reply
 

Pycom on Twitter