Search found 18 matches

by Gabi
Wed Apr 20, 2016 5:34 pm
Forum: WiPy and CC3200 boards
Topic: IRQ on Pin throwing TypeError: can't convert to int
Replies: 15
Views: 13482

Re: IRQ on Pin throwing TypeError: can't convert to int

The best way to use interrupt handlers is to have variables accessible to both the handler and the main program. Typically the main program executes a loop which runs forever. The interrupt handler updates the variables and sets a flag to tell the main loop it has done so. The main loop reads the d...
by Gabi
Tue Apr 19, 2016 8:40 pm
Forum: WiPy and CC3200 boards
Topic: IRQ on Pin throwing TypeError: can't convert to int
Replies: 15
Views: 13482

Re: IRQ on Pin throwing TypeError: can't convert to int

Sorry for the double post m(_*_)m The issue is in the access of the flag flags = pin.irq().flags() I got this line from here: https://github.com/micropython/micropython/wiki/Hardware-API#irqs But the doc is not good...indeed when I try to do callback = echoPin.irq(trigger = Pin.IRQ_RISING | Pin.IRQ_...
by Gabi
Tue Apr 19, 2016 8:07 pm
Forum: WiPy and CC3200 boards
Topic: IRQ on Pin throwing TypeError: can't convert to int
Replies: 15
Views: 13482

Re: IRQ on Pin throwing TypeError: can't convert to int

Hi, When you said And I don't know, if printing a tuple of integers with the %s format specifier works. Depends on what exactly is returned by rtc.now(). I have to try it on WiPy You were right, I tested it on the REPL and I got an error. So I have removed the format %s: >>> print(raising_time) (201...
by Gabi
Mon Apr 18, 2016 4:04 pm
Forum: WiPy and CC3200 boards
Topic: IRQ on Pin throwing TypeError: can't convert to int
Replies: 15
Views: 13482

Re: IRQ on Pin throwing TypeError: can't convert to int

Hi, I am not sure any parameter is missing, it is just the prototype of the function and it requires some parameters optional or not. I have put them in the init of the IRQ. But, as you said, let's wait for the confirmation from @danicampora. Here, as per my understanding, pin_int.irq()() is only tr...
by Gabi
Sun Apr 17, 2016 4:59 pm
Forum: WiPy and CC3200 boards
Topic: IRQ on Pin throwing TypeError: can't convert to int
Replies: 15
Views: 13482

Re: IRQ on Pin throwing TypeError: can't convert to int

Well, I have checked that alreadyn but correct me if I am wrong. The line 48 is echoPin.irq()() Now, this line is supposed to trigger the callback: http://micropython.org/resources/docs/en/latest/wipy/library/machine.Pin.html?highlight=irq#pin.irq I want to do that to test the interruption, to valid...
by Gabi
Sun Apr 17, 2016 2:13 pm
Forum: WiPy and CC3200 boards
Topic: IRQ on Pin throwing TypeError: can't convert to int
Replies: 15
Views: 13482

IRQ on Pin throwing TypeError: can't convert to int

Hi guys, I am currently playing with my HC-SR04 ultrasonic sensor to be able to detect wether my entry door is closed or not. Now, I have done: import time import machine from machine import Pin, RTC RTC_USEC_POS = 7 RTC_SEC_POS = 6 RTC_MIN_POS = 5 MIN_TO_SEC = 60 SEC_TO_USEC = 1000 TRIGGER_TIME = 1...
by Gabi
Fri Apr 01, 2016 6:53 pm
Forum: WiPy and CC3200 boards
Topic: Read temperature with TMP-36 and WiPy ADC
Replies: 6
Views: 9704

Re: Read temperature with TMP-36 and WiPy ADC

Hi Daniel, Thank you very much for your reply :) (and sorry for the late answer, I did not see it before ^^") Here are the software running on my WiPys: (sysname='WiPy', nodename='WiPy', release='1.0.0', version='v1.4.6-21-gff736d6 on 2015-09-27', machine='WiPy with CC3200') and (sysname='WiPy', nod...
by Gabi
Tue Mar 22, 2016 9:28 pm
Forum: WiPy and CC3200 boards
Topic: Read temperature with TMP-36 and WiPy ADC
Replies: 6
Views: 9704

Read temperature with TMP-36 and WiPy ADC

Hi, I just received my wipy and my 2 TMP36 sensors and I wanted to test them. So, I have configure my ADCs on the wipy on GP2 and GP5 and I got some weird values: they were around 1800-2000. Now, I have read all of the messages here: http://forum.micropython.org/viewtopic.php?f=2&t=251&p=1167 with m...