how can I debug the code of my arduino without arduino zero - debugging

The only way I know how to debug an arduino is usen the SerialPort which is like using a odd tool after trying vsCode in my job. Could someone show me how is it the prefered way to acomplish it?
SerialPort is just too slow and if I want to know what is happening in a critical section is not the best way to do it.

Arduino doesn’t come with a custom debugging tool. I`m sorry to tell you that unlike most other IDEs, there is no official Arduino debugging feature inside the arduino IDE.
However, thanks to the community we have access to unofficial tools like using Arduino simulators and emulators or and external software debuggin tool.
Personally I prefer simulator. Once you get use of it is simpler.
More about this here: https://www.circuito.io/blog/arduino-debugging/

Related

Arduino IDE Alternatives for Mac OS X

I'm trying to find an alternative to the arduino text editor for obvious reasons. I can't seem to get sublime text to work with Stino (a sublime package), I think it's because I'm using arduino 1.6.4. Are there any alternatives or am I stuck with the arduino IDE? Or has anyone managed to get Stino working on sublime?
Several months ago, I ran into an issue with not being able to use the Arduino IDE very well for different reasons. I did some research and found codebender.cc.
Codebender works as a plugin to Chrome or Firefox, and is completely cross platform. I have used it on Windows 7,8, OSX, and on Chrome OS.
I hope you have luck with your project in whatever environment you use, Good Luck!

Good GUI library for program that connects to a microcontroller?

I'm trying to find a good GUI library I could use to create a program on the computer that connects to a microcontroller by USB. I've never done any GUI work before but I have done a lot of webpage design/tools. We are going to program the microcontroller with C but I don't think the GUI will need to be C. It needs to work on Windows, so probably compile on Windows too. I've also never done any USB transmission but I'm hoping to take it one step at a time.
Right now I'm looking at using GTK but it needs a bunch of other things to download with it. I'm also going to look at QT and someone else suggested making a Windows Forms Application. There's a lot of options out there so I'm having trouble figuring it out.
As for my requirement, it just needs to be a very simple GUI that has a few control buttons, a display area (info from microcontroller), a notification area (basically error messages go here), and maybe a graph. I've included a prototype GUI help give you an idea of what I'm doing.
Edit: It needs to run and compile on Windows. We don't really have a budget for it, free open source is preferred. I don't need something elaborate and fancy, I just want to get it done as fast as possible.
We are using a TTL-232R cable, UART interface. I know nothing about USB transmission, school has crushed me.
From what you've specified, I would set base-camp up at Java.
Java in Eclipse to write the code.
Java Swing libraries (helped by the WindowBuilder plugin for Eclipse) to "draw" the GUI. It is very easy to create "Windowsy" GUIs using these.
JFreeGraph libaries to allow you to create graphs very easily, again from within Eclipse.
RXTX library for "virtual COM port" serial communication within Java (it doesn't sound like you're using proper USB, but just RS232 with a USB adapter).
Your created GUI would run on any machine with Java installed, which is not a big ask for the end user. You can even create a Windows executable/installer from the resulting Java files if you wanted it to be a (apparently) native Windows application.
And - bonus - all the tools mentioned are free as a bird.
It will kind of depend on what kind of compiler, IDE, etc you will settle on. If you are going to windows cold, and
money is an issue, then open source is always a good thing to look at. I have enjoyed using eclipse and Code::Blocks IDEs. For C/C++, I use minGW. In terms of GUI plug-ins, HERE are some conversation with GUI recommendations specifically for use with Code::Blocks.
If money is not an issue, I have use National Instruments LabWindows/CVI full dev kit forever. It is one of the easiest ANSI C compilers/IDE I have ever used. It is only ANSI C, but has extensions to make using instrumentation easy. I have written a little USB stuff (not much), sockets, instrumentation, and many GUI apps.
Please comment what tools you currently prefer, I may have other suggestions.
Lazarus CodeTyphon has cross platform native compiler with GUI working on every supported platform. It supports 8 OS-CPU host layers (Win32, Win64, Linux32, Linux64, FreeBSD32, FreeBSD64, Solaris32 and Solaris64), and 25+ OS-CPU target layers. It also incorporates many graphical widgets and SCADA like behaviour with PascalSCADA and other components. There are wrappers for LibUSB.
I would use Microsoft Visual Studio to develop the GUI. They offer a free version called Express. I would use the C# language but MSVS supports other languages as well so just choose whichever you're most comfortable with. The best thing about MSVS is that there are millions of developers out there, which means that you will be able to search for and find lots of examples for how to use an RS-232 COM port or USB interface. I'm guessing that you'll be able to find GUI objects for graphing and other objects as well. (The basic stuff like buttons and edit boxes is all built into MSVS.)
BTW, you need to sort out whether you're using an RS-232 COM port or a USB interface. They're both serial interfaces but they're not the same thing. Either could work.

Qt code port to marmalade

I know Marmalade is very good for c++ code porting but I would like to know how could it possible to port my Qt code to marmalade?
Can anyone tell how simple "hello world" Qt-application could be ported to marmalade?
I have setup every thing for marmalade on Windows machine. Also I have already setup Qt.
Please, share any kind of info or tutorials here.
I'm pretty sure it's not possible with IwGx and its subcomponents and probably not with s3e. You can try using IwUI, but I don't think it will work.
Another thing, Qt doesn't support all the platforms Marmalade does, so you won't reach the clients you might want to get to.
I found this on the marmalade forum, which might be useful.
http://www.madewithmarmalade.com/ru/node/57339
Hope it helps!

Arduino programming on Mac OS X with Xcode 5?

Is there a good reference on how to set up an Arduino programming environment with Xcode?
An ideal answer would be along the lines of, "Oh yes, there's an active project on Google Code, just download the .dmg, copy the ${Xcode magic config file} to ${somewhere in ~Library}, restart Xcode and select "New Arduino Project" from the File menu. Click Build with your Arduino plugged in and it uploads it direct to the hardware."
Google gives a couple of hits, but they're kind of vague and out-of-date (specifically, the way Xcode does project templates changed between Xcode 3 and 4 and I can't find an Xcode 4 template.) I've officially outgrown Processing and I'd prefer not to blight my home life with Eclipse if at all possible.
You can actually use the arduino GUI to compile and upload, and set the editor to external in the preferences. That way, you can edit the C++ (PDE) files from xcode, and have arduino generate the actual CPP and build the whole shebang.
You can also use XCode to write plain C++/C for the arduino, using the avr-gcc compiler.
Have a look at: https://stackoverflow.com/a/8192762/153835
You can then use the plain avrdude upload tool to program the arduino. Have a look at: http://www.ladyada.net/library/arduino/bootloader.html
It used to be that the protocol spoken by Arduino was a modification of the STK500 protocol, and that only the avrdude bundled with arduino could speak it. I don't know if the mainstream avrdude was upgraded, or if you still have to resort to the avrdude inside the Arduino folder.
I have just come across embedXcode which does exactly what I want.
Alternatively, if you are looking for a solution that is independent of XCode (or just another solution), check out CrossPack for AVR Development. Essentially, it is an AVR toolchain for OSX
This will allow you to develop outside of the Arduino IDE with C/C++. It is terminal line only.
https://www.obdev.at/products/crosspack/index-de.html
However, the instructable below gives steps for using it with the Eclipse IDE (well, the Eclipse IDE using it).
http://www.instructables.com/id/Setup-AVR-programming-on-OS-X-using-Eclipse/?ALLSTEPS
I also asked around on the Arduino forums and they're at the point where someone's posted a Makefile which works for me, but the templating system for Xcode4 is vastly different to Xcode3 and apparently still in some state of flux.
So as of May 2011 the answer I wanted to hear still doesn't exist but we're getting closer.

Which is easier to write drivers for? Windows or LInux?

I am trying to learn a little about driver development and my question is, which OS has an easier API to develop drivers with? Windows or Linux?
Remember that I am new to this.
Thanks
If you are doing this for learning (I guess its your case), then go for Linux, you will have a more general ideal on how an OS works, you will interact with low level implementation straight to the core.
If you are just writing a driver for a device, I recommend using Visual Studio under Windows, it has a lot of features that will really help on your devel.
I am pretty sure you'll get lots of Windows vs Linux war here, unfortunately.
On Windows, you'll get pretty good development tools, with some awkward stuff, but that you can get along with easily. API is documented provided you have access to a Windows Developer account. Remote debugging is supported and it helps a lot for these kernel stuff that are triggering BSOD so quickly.
On Linux, you'll need to get your hands more dirty. Rubini's "Linux Device Drivers" is a very good starting point. Openness will bring you more flexibility, and more understanding of what is happening.
This tutorial might be helpful.
It is about writing a simple device driver for linux.
My personal idea is Linux. You can see the entire code other than an API.
I think Windows is good.
Because it has a rich set of API's which is easier to use

Resources