Hi, First thing to mention is that I've not had many/any dealings with serial port stuff, so I'm just working from what I see.
I'm guessing you're working with pyserial - I don't see serial modules in the core module docs, and a google of serialObject got me to the pyserial page. So, looking at the pyserial docs - in serialposix.py (which is what you're ultimately going to be using as you're doing this on linux), there seems to be a lot of stuff surrounding custom baud rates in _reconfigurePort. Basically, when the object is constructed and open() is called, _reconfigurePort is called. One of the tasks of that function is to check the baud rate. First, it checks to see if it's one of the preconfigured rates (those that are returned by getSupportedBaudRates), and if not, it tries to configure it using magic I don't understand (again, because I'm not used to working with serial ports), and it only bombs out if it absolutely can't do it. So, with all of that said, it basically seems to be simply a case of setting the baudrate attribute to 31250 and hoping for the best. Chances are, it won't complain. :) As I said, this is only from reading the code, not using it, so you might need some more specific help, but it does look like it should work. Best of luck. Aoife 2009/5/18 Harry Van Haaren <[email protected]>: > Hey guys, > > I've managed to run myself into a lovely litte problem I think. > I'm working on an Arduino project, in which I hope to use > python to "understand" the MIDI messages the Arduino sends. > > The data will be coming in on /dev/ttyUSB0 (linux) which > the python serial module opens no problem. Also when I call > serialObject.getSupportedBaudrate I get a tuple of all the > supported rates. > > Unfortunalty 31250 baud isnt there... And the MIDI baudrate is 31250! > > So either: A: I get over it, and reupload the code with a different > baudrate > each time I need to switch between debugging code with the > PC and using the device in real life. > B: There is some way to make python understand the 31250 baudrate? > Google didnt show me any obvious "python midi baud rate" page.. > > Cheers for reading, -Harry > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Python Ireland" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.ie/group/pythonireland?hl=en -~----------~----~----~----~------~----~------~--~---
