Re: [Tutor] truncated dictionary return

2013-12-02 Thread Wolfgang Maier
richard kappler gmail.com> writes: > > > Now I'm completely lost. While opening the serial port outside the function sounds like a good idea, I'm thinking that might not work unless I am mistaken. The sensorRead function once it's called would then basically own the serial port barring other tr

Re: [Tutor] truncated dictionary return

2013-12-01 Thread richard kappler
Would something like if len(dict) = 8 return d else continue work? On Sun, Dec 1, 2013 at 8:54 PM, richard kappler wrote: > Now I'm completely lost. While opening the serial port outside the > function sounds like a good idea, I'm thinking that might not work unless I > am mistaken. Th

Re: [Tutor] truncated dictionary return

2013-12-01 Thread richard kappler
Now I'm completely lost. While opening the serial port outside the function sounds like a good idea, I'm thinking that might not work unless I am mistaken. The sensorRead function once it's called would then basically own the serial port barring other traffic, yes? That won't work as the same seria

Re: [Tutor] truncated dictionary return

2013-12-01 Thread spir
On 12/01/2013 08:28 PM, richard kappler wrote: I have a script that reads sensor values gathered by an Arduino board from serial as a dictionary, said values to later be used in the AI for Nav & Control. Here's the script: #!/usr/bin/python def sensorRead(): import serial from time im

Re: [Tutor] truncated dictionary return

2013-12-01 Thread Paul Simon
"Wolfgang Maier" wrote in message news:loom.20131201t230651-...@post.gmane.org... > richard kappler gmail.com> writes: > >> >> I have a script that reads sensor values gathered by an Arduino board >> from > serial as a dictionary, said values to later be used in the AI for Nav & > Control. Here

Re: [Tutor] truncated dictionary return

2013-12-01 Thread Wolfgang Maier
Hi again, think I spotted the problem now: you’re setting up your connection everytime you enter the function (with the serial.Serial call), but I guess you’re calling that function repeatedly to retrieve lines. That’s wrong and means you could loose data that was sent while you weren’t listening.

Re: [Tutor] truncated dictionary return

2013-12-01 Thread Wolfgang Maier
richard kappler gmail.com> writes: > > I have a script that reads sensor values gathered by an Arduino board from serial as a dictionary, said values to later be used in the AI for Nav & Control. Here's the script: > #!/usr/bin/python > > > def sensorRead(): >     import serial >     from time

[Tutor] truncated dictionary return

2013-12-01 Thread richard kappler
I have a script that reads sensor values gathered by an Arduino board from serial as a dictionary, said values to later be used in the AI for Nav & Control. Here's the script: #!/usr/bin/python def sensorRead(): import serial from time import sleep sensors = {} sensors = dict.fro