Hi Davide,
why dont you just do this for edge detection (adapted from
configs/gladevcp/complex/complex.py):
def on_led_pin_changed(self,hal_led,data=None):
if hal_led.hal_pin.get():
print "LED changed to true"
else:
print "LED changed to false"
- Michael
Am 24.01.2012 um 00:39 schrieb Spiderdab:
> It works!
> I don't know how much it could be useful for other, but here is the
> modified hal_glib.py code. I added 'value-is-true' and 'value-is-false'
> to evaluate a bit-pin state.
> added the GBitPin Class, so it is not mixed with GPin.
>
> I'm attaching this code, in case someone would like to evaluate.
>
> Ciao, Davide.
>
> On lun, 2012-01-23 at 22:37 +0100, Spiderdab wrote:
>> Hi, i was looking into hal_glib.py, because i wanted to add a boolean
>> possibility other than 'value-changed'.
>> This way one can monitor a bit-pin and set an handler if it's true.
>>
>> Am I assuming the right idea?
>> do you think it's a trivial thing to do?, or do i have to change also
>> other files?
>>
>> Thanks, Davide.
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>> _______________________________________________
>> Emc-developers mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
> <hal_glib_GBitPin-MOD.zip>------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2_______________________________________________
> Emc-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-developers
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers