Advice on using python instead of VB or C#
carlyn
Posts: 78
I want to continue doing experiments with propellor and basic stampsd, Ive always used VB or c# to communicate with the chips. But Ive swiched over to linux ubuntu. And I like it. I have enough trouble programming properrlors and basic stamps. One thing I liked about the microsoft languages was the seial port object that , you didnty even know how how it worked it just did, but with a language like python I could do thee same thing with a few lines of code I guess. And Ive heard it easy to pick up even if i have to go and buy a book. The ide I have on my ubuntu system for python is the simplest ide ive ever seen. Just to give me anidea, could someone post the cost the code so that I can send and recieve from the basic stamp or prop ?
Mike.
Mike.
Comments
VB in Linux? Can that be done without running a Windows virtual OS?
Serial in Linux is a bit different. Personally, I think it is easier once you understand the key basic principles of Unix/Linux.
A. Everything gets 'mounted' as a file system - included i/o ports
B. There are just two modes of data transfer - by character stream and by blocks. Blocks are faster and used mostly for hard disk and video.
These days, Ubuntu easily supports USB to serial as a device - often listed as USBtty0 or some other number in the /dev directory. But the simple fast is I just load BST in Linux and use it, I've never had to fool with configuration of the serial ports in recent versions. But I do suspect you can confuse Linux if you have several applications open at the same time - like TeraTerm and BST. They will not be allocated the same USBtty# and if you have only one USB to serial device plugged in, something will go without.
All you need on the PC is pySerial http://pyserial.sourceforge.net/. Not sure but it may already be installed on most Linux distros. It's easy to install if not.
On the Propeller just use FullDuplexSerial and you are in business.
I did run Ubuntu using virtual box in windows and got to liking it. So I set up some partitions and now dual boot mostly Linux I tech Gimp, that photoshop type program. Seems more stable on Ubuntu than windows. I didnt have to supply drivers for my very new printer and modem router either, Ubuntu 'new' what things I had plugged in and they just worked. Is there a flavor of Linux as good as Ubuntu thinking of tripple booting I can always just boot into windows and continue using VB, I just wanted to fully migrate to Linux....eventually. So I will try out Heaters suggestion below. Thank you very much though.
Quick note to Loopy, yes I think using Mono you can actually program C# and VB and others in Linux. I installed Mono, but for me too many notes and ropes to learn to get that right !!!. If I really wanted to keep using VB I'd just boot into windows. I think I just want to learn python becuse I know other peole here do but probably in windows?????? or not !
This comment confuses me. BST has worked on Linux and SimpleIDE 0-8-5 now offers SPIN support on Linux/Windows/Mac. That will get you PROGRAMMING on the Propeller side. I don't think there is a native Linux solution for the BS2, I don't think so.
Python isn't going to help you program either but it would allow you to write a program to talk to an application running on either from the PC side via a serial connection. You probably are aware of that and your statement above was just confusing.
Offically, it's "GNU Compiler Collection", though it was originally only a C compiler. It now supports C++, Objective C, Objective C++, Java, Fortran, and possibly other languages.
Good question. GCC = GNU Compiler Collection.
GNU = GNU's Not Unix. It's recursively defined like that.
GNU Is the name of the project to replace Unix started by Richard Stallman many years ago.
Ubuntu is one incarnation of that idea.
GCC is a compiler collection because it can compile C and C++ and Fortran and a bunch of other languages. Not only that but can compile all those languages to binaries that run on x86 or ARM or MIPS or Spark or a bunch of other processors. GCC is used to compile C++ for the AVR chip used in Arduino (Yes, that is C++ not C). There is a GCC to compile C/C++ for the Propeller, propgcc.
SimpleIDE is an IDE for writing code in C or C++ or Spin/PASM. When using Spin/PASM it does not use GCC but rather an new open source Spin compiler.
As far as I know SimpleIDE can be installed the same way for Ubuntu as Debian. I have only used Debian.
You should have no fear of C it is a wonderful thing. C++ should be approached more cautiously. Still, nothing wrong with using Spin on the Prop. You will still need Python or something else on on the PC if you want Prop and PC to communicate over a serial link. My preference is for JavaScript running as a command line program under Node.js.
or could be the GNU's Not Unix. now my head hurts
GIMP = GNU Image Manipulation Program. Many complain about that name but I love it.
I can see now why the Arduino guys talk about "wiring" and "sketches" and carefully never mention what is actually underneath. It has saved them a lot of questions and user confusion. Personally I hate that approach. The reality is all straight forward when you get the hang of it:)
I only ran the hello program, and tested a spin project. They both worked.
If I remember correctly there only is a little bit of command line to do.. give it a try!
Massimo
Pyserial looks mighty interesting to me. This would enable a custom interface to a BS2 or a Propeller that would look very professional.
Mike