Search found 288 matches

by Turbinenreiter
Sat Jul 12, 2014 2:43 pm
Forum: Hardware Projects
Topic: Module for TMP102 temperature sensor
Replies: 16
Views: 29185

Re: Module for TMP102 temperature sensor

This means that we should include docstrings in micropython modules, right?
by Turbinenreiter
Wed Jul 09, 2014 12:28 pm
Forum: General Discussion and Questions
Topic: equivalent to Arduinos pulseIn(), micros()
Replies: 5
Views: 7567

Re: equivalent to Arduinos pulseIn(), micros()

def time_pin(pin): m = micros_timer.counter p = pin.value pyb.disable_irq() while not p(): pass m(0) while p(): pass count = m() pyb.enable_irq() return count Ok, I use this function in a while loop. A script with only this function in a while loop runs forever. Using @micropython.native() raises F...
by Turbinenreiter
Tue Jul 08, 2014 7:33 am
Forum: General Discussion and Questions
Topic: equivalent to Arduinos pulseIn(), micros()
Replies: 5
Views: 7567

Re: equivalent to Arduinos pulseIn(), micros()

the code from issue 570: import pyb micros_timer = pyb.Timer(2, prescaler=83, period=0x3fffffff) pin = pyb.Pin('X1', pyb.Pin.IN, pyb.Pin.PULL_DOWN) # crashes, replace with pin = pyb.Pin.board.X1 @micropython.native def time_pin(pin): m = micros_timer.counter p = pin.value pyb.disable_irq() while not...
by Turbinenreiter
Mon Jul 07, 2014 1:56 pm
Forum: General Discussion and Questions
Topic: equivalent to Arduinos pulseIn(), micros()
Replies: 5
Views: 7567

equivalent to Arduinos pulseIn(), micros()

I'm trying to read signals from an RC-reciever (the ones going to the Servos) - they use PWM with pulses of somewhat around 2µs. As there is no pulseIn() (yet?), I thought of measuring the time using interupts, however the pyb.millis() timer isn't fast enough for that. I will be tackling this proble...
by Turbinenreiter
Fri Jul 04, 2014 7:09 pm
Forum: General Discussion and Questions
Topic: development of a module for the bmp180 pressure sensor
Replies: 24
Views: 26614

Re: development of a module for the bmp180 pressure sensor

Btw, did you notice another guy's module for another temperature sensor: viewtopic.php?f=5&t=154 ? What would be really cool if you guys communicated and came to a common naming conventions on which method names to use to get temperature, etc. - in other words, established an interface which temper...
by Turbinenreiter
Thu Jul 03, 2014 5:25 am
Forum: General Discussion and Questions
Topic: development of a module for the bmp180 pressure sensor
Replies: 24
Views: 26614

Re: development of a module for the bmp180 pressure sensor

Ok, so it's local vs. self instead of public vs. non-public. You're also reading the chip_id from the wrong address (the code shows 0xAA, but it lives at 0xD0). Copy paste error, already catched and fixed that. I went through all variables and looked what's in there. In a function like calc_temp, I ...
by Turbinenreiter
Wed Jul 02, 2014 8:13 pm
Forum: General Discussion and Questions
Topic: development of a module for the bmp180 pressure sensor
Replies: 24
Views: 26614

Re: development of a module for the bmp180 pressure sensor

Say I do: Python 2.7.6 |Anaconda 1.9.2 (64-bit)| (default, Jan 17 2014, 10:13:17) [GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> class test(): ... def __init__(self): ... t=1 ... self.a=2 ... >>> br = test() >>> br.t Trace...
by Turbinenreiter
Wed Jul 02, 2014 5:52 pm
Forum: General Discussion and Questions
Topic: development of a module for the bmp180 pressure sensor
Replies: 24
Views: 26614

Re: development of a module for the bmp180 pressure sensor

No, and it's not going to be implemented (as in: "there's strong opposition to implementing it"). Over-dynamicity features like that is the cause of slowness. Nowadays, one should expect the code to be compiled to efficient machine code, rather than the fact that object is implemented in particular...
by Turbinenreiter
Wed Jul 02, 2014 1:34 pm
Forum: General Discussion and Questions
Topic: development of a module for the bmp180 pressure sensor
Replies: 24
Views: 26614

Re: development of a module for the bmp180 pressure sensor

Okay, I will use the second version. Lowercase the object, uppercase the class.
Thanks.