Re: Python serial data aquisition

2005-01-24 Thread Miki
Hello Flávio, > My problem is to how to recover my reading from these bytes, since > pyserial gives me a character (string) from each byte... I dont know > how to throw away the unneeded bits and concatenate the remaining > bits to form a number... See the array module. Also http://tebeka.bizhat.

Re: Python serial data aquisition

2005-01-12 Thread Flavio codeco coelho
[EMAIL PROTECTED] (Flavio codeco coelho) wrote in message news:<[EMAIL PROTECTED]>... > struct.unpack returns a tuple of values represented by a string(the > output of the read command) packed according to the format specified > by ">BB" > In this forma string, ">" stands for big Endian representa

Re: Python serial data aquisition

2005-01-11 Thread Bengt Richter
On 11 Jan 2005 07:51:35 -0800, [EMAIL PROTECTED] (Flavio codeco coelho) wrote: >[EMAIL PROTECTED] (Bengt Richter) wrote in message news:<[EMAIL PROTECTED]>... >> On 9 Jan 2005 14:13:28 -0800, [EMAIL PROTECTED] (Flavio codeco coelho) wrote: >> >> >Hi, >> > >> >I am using pyserial to acquire data f

Re: Python serial data aquisition

2005-01-11 Thread Flavio codeco coelho
[EMAIL PROTECTED] (Bengt Richter) wrote in message news:<[EMAIL PROTECTED]>... > On 9 Jan 2005 14:13:28 -0800, [EMAIL PROTECTED] (Flavio codeco coelho) wrote: > > >Hi, > > > >I am using pyserial to acquire data from an A/D converter plugged to > >my serial port. > > > >my hardware represents analo

Re: Python serial data aquisition

2005-01-11 Thread Diez B. Roggisch
> It all looks pretty god but there is a couple of things I still don't > understand, 1) in Steve's solution (which seems equivalent to your > own), he does the masking, shifts by seven, and then sums the two > numbers while you, instead of summing, use a logical or. How can these > operations be

Re: Python serial data aquisition

2005-01-11 Thread Flavio codeco coelho
Paul Rubin wrote in message news:<[EMAIL PROTECTED]>... > or something like that. Hi Paul, thanks for your answer. I Noticed, however that although your solution is almost identical to that of Michael (earlier in the thread) your masking for the second byte is differen

Re: Python serial data aquisition

2005-01-11 Thread Bengt Richter
On 9 Jan 2005 14:13:28 -0800, [EMAIL PROTECTED] (Flavio codeco coelho) wrote: >Hi, > >I am using pyserial to acquire data from an A/D converter plugged to >my serial port. > >my hardware represents analog voltages as 12bit numbers. So, according >to the manufacturer, this number will be stored in

Re: Python serial data aquisition

2005-01-11 Thread Flavio codeco coelho
[EMAIL PROTECTED] (Michael Fuhr) wrote in message news:<[EMAIL PROTECTED]>... > If the actual byte and/or bit order is different then you'll have > to modify the expression, but this should at least give you ideas. Hi Michael, It all looks pretty god but there is a couple of things I still don't

Re: Python serial data aquisition

2005-01-10 Thread Steve Holden
Flavio codeco coelho wrote: [EMAIL PROTECTED] (Michael Fuhr) wrote in message news:<[EMAIL PROTECTED]>... If the actual byte and/or bit order is different then you'll have to modify the expression, but this should at least give you ideas. Thanks Michael and Steve, I'll put your Ideas to the test A

Re: Python serial data aquisition

2005-01-10 Thread Paul Rubin
[EMAIL PROTECTED] (Flavio codeco coelho) writes: > I'll put your Ideas to the test ASAP, meanwhile, could you point me to > references to these bit operations in Python? I am new to this stuff, > and might need to do more of this to support other hardware... > > I havent been able to find anything

Re: Python serial data aquisition

2005-01-10 Thread Flavio codeco coelho
[EMAIL PROTECTED] (Michael Fuhr) wrote in message news:<[EMAIL PROTECTED]>... > If the actual byte and/or bit order is different then you'll have > to modify the expression, but this should at least give you ideas. Thanks Michael and Steve, I'll put your Ideas to the test ASAP, meanwhile, could y

Re: Python serial data aquisition

2005-01-09 Thread Michael Fuhr
[EMAIL PROTECTED] (Flavio codeco coelho) writes: > my hardware represents analog voltages as 12bit numbers. So, according > to the manufacturer, this number will be stored in two bytes like > this; > |-bits(1-8)---| > Byte1: x x x n1 n2 n3 n4 n5 > Byte2: x n6

Python serial data aquisition

2005-01-09 Thread Flavio codeco coelho
Hi, I am using pyserial to acquire data from an A/D converter plugged to my serial port. my hardware represents analog voltages as 12bit numbers. So, according to the manufacturer, this number will be stored in two bytes like this; |-bits(1-8)---| Byte1: x x x n1

Re: Python serial data aquisition

2005-01-09 Thread Steve Holden
Flavio codeco coelho wrote: Hi, I am using pyserial to acquire data from an A/D converter plugged to my serial port. my hardware represents analog voltages as 12bit numbers. So, according to the manufacturer, this number will be stored in two bytes like this; |-bits(1-8)---