Popular recipes by cheeng shu chin http://code.activestate.com/recipes/users/163970/2010-12-26T12:20:48-08:00ActiveState Code Recipescsc prototype to arduino board with python API. part I (C) 2010-12-26T12:14:33-08:00cheeng shu chinhttp://code.activestate.com/recipes/users/163970/http://code.activestate.com/recipes/577520-csc-prototype-to-arduino-board-with-python-api-par/ <p style="color: grey"> C recipe 577520 by <a href="/recipes/users/163970/">cheeng shu chin</a> (<a href="/recipes/tags/api/">api</a>, <a href="/recipes/tags/arduino/">arduino</a>, <a href="/recipes/tags/c/">c</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/serial/">serial</a>). Revision 2. </p> <p>Few day ago, i'm try out arduino UNO robotic board. found it not that easy to use (C &lt;--> Python). I wrote a arduino UNO prototype to serial API, which can interface to any programming Language. as long as the programming Language can interface to virtual serial port and using serial API, this recipe can be use... Requirement:</p> <p>Upload this recipes to arduino uno with my prototype code (name "csc.pde" as below)</p> <p>Base concept:</p> <ol> <li>wait from serial reply "?" and ready for read</li> <li>pass function name as string to arduino uno</li> <li>pass all argument as string to arduino uno</li> <li>read result as string from arduino uno</li> </ol> <p>Can easy extend it to support:</p> <ol> <li>python API(open source and i like most) in part II</li> <li>other arduino board</li> <li>Bluetooth with serial interface</li> <li>any PC can control the arduino board easily via your prefer Language.</li> <li>interrupt </li> </ol> <p>Future add-on:</p> <ol> <li>Json string passing to arduino</li> <li>Json Reply from arduino</li> <li>thread base design</li> <li>Interrupt direct call</li> </ol> <p>Please study it and extend it and share among open source members especially in python... :)</p> <p>Next <a href="http://code.activestate.com/recipes/577521-csc-prototype-to-arduino-board-with-python-api-par/">Part II</a></p> csc prototype to arduino board with python API. part II (Python) 2010-12-26T12:20:48-08:00cheeng shu chinhttp://code.activestate.com/recipes/users/163970/http://code.activestate.com/recipes/577521-csc-prototype-to-arduino-board-with-python-api-par/ <p style="color: grey"> Python recipe 577521 by <a href="/recipes/users/163970/">cheeng shu chin</a> (<a href="/recipes/tags/api/">api</a>, <a href="/recipes/tags/arduino/">arduino</a>, <a href="/recipes/tags/c/">c</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/serial/">serial</a>). Revision 2. </p> <p>This is the Python API for my arduino uno board. this is base on what i posted in <a href="http://code.activestate.com/recipes/577520-csc-prototype-to-arduino-board-with-python-api-par/?in=user-163970">Part I</a> .. I didn't spend time to comments it... I'll do it once free soon. Please study it and extend it and share among open source members especially in python... :)</p> <p>The file name is "cscarduino.py"</p> <p>if you facing "Pyserial Invalid Handle" issue in your 64bit windows 7 server, Please refer to this:</p> <ol> <li><a href="http://permalink.gmane.org/gmane.comp.python.tutor/67030">link1</a></li> <li><a href="http://www.mail-archive.com/tutor@python.org/msg46974.html">link2</a></li> </ol> Progress Bar form WX in Child Thread of Main Python Code. (Python) 2006-04-14T09:30:59-07:00cheeng shu chinhttp://code.activestate.com/recipes/users/163970/http://code.activestate.com/recipes/491258-progress-bar-form-wx-in-child-thread-of-main-pytho/ <p style="color: grey"> Python recipe 491258 by <a href="/recipes/users/163970/">cheeng shu chin</a> (<a href="/recipes/tags/threads/">threads</a>). Revision 2. </p> <p>I come across some cases, where I need to hook a progress bar from WX to my current running python project/script to indicate the current process progress. Some how if you use MainLoop() in child thread will cause the WX session hang and EVT handle will failed. After some study, found that WXAPP class instance and MainLoop have to same namespace. I manage to redesign it and make it work now. Just mail/vote me, if you feel this is useful for your project. E-Mail : <a href="mailto:cheengshuchin@gmail.com">cheengshuchin@gmail.com</a></p> Parse Command Line String from CommandLine or String given base on windows OS (Python) 2007-05-18T02:01:32-07:00cheeng shu chinhttp://code.activestate.com/recipes/users/163970/http://code.activestate.com/recipes/436187-parse-command-line-string-from-commandline-or-stri/ <p style="color: grey"> Python recipe 436187 by <a href="/recipes/users/163970/">cheeng shu chin</a> (<a href="/recipes/tags/sysadmin/">sysadmin</a>). Revision 3. </p> <p>This is a way to parse command line from user provided string or try to get the original Argv from Windows OS Platform.</p>