Arduino Due in Atmel Studio 6.1. without Visualmikro - arduino

I prefer the tutorial from http://www.engblaze.com/tutorial-using-atmel-studio-6-with-arduino-projects/ over Visualmikro because I love being able to jump inside the arduino functions and modify them without having to install any kind of plugin.
I tried compile my project following the tutorial but it won't work: "undefined reference to _sbrk". Which sounds like a really bad linker error to me?
I needed to adapt a few things because the tutorial was written for an older version of the IDE and is targeting AVRs and not SAMs:
GNU C++/Symbols
List item
F_CPU = 84000000L
ARDUINO=154
GNU C++/Directories
[...]\Arduino\hardware\arduino\sam\cores\arduino
[...]\Arduino\hardware\arduino\sam\variants\arduino_due_x (had to change this one)
[...]\Arduino\hardware\arduino\sam\system\libsam
ARM/GNU Linker/Libraries
libcoreDue.a (I added Due, to be able to identify the type of arduino)
libsam_sam3x8e_gcc_rel_a
as well as the paths to those two files.
Any idea what I could have missed?
Thank you so much!

Related

Trying to write a custom library for a blinking light

I'm new to arduino and want to make some libraries. Full Disclosure: I am not a programmer and have been following some tutorials and reading as much as I can about rewriting functions as libraries. Yet, I still have some questions.
Example: I want to set up a custom blink pattern for the LEDpin on my arduino UNO. I want to include this blinking code on future projects and would like to use it with the #include statement when I start a new project. (easy?)
As an example:
The often referenced Morse Code Library tutorial here
I have the files saved in ..\My Documents\Arduino\libraries\Morse\morse\
there are 4 files:
keywords.txt
morse.c
morse.h
morse.ino
They exist in those files exactly as the final code examples on the linked page.
Question 1: can anyone verify if this tutorial is accurate for an
Arduino Uno using 1.6.4?
I can not get this or any "library" that I "create from scratch" to compile or upload to the mcu.
It doesn't seem to get any simpler than this in terms of a "custom library" tutorial. Would it help to post the error codes or PEBCAK?
Much of the style guide stuff was too advanced for me to follow but I did try to put the .c and .h files into a sub directory called \src. It didn't help.
I can't get rid of the ..\Morse\morse double directory. I am doing everything in arduino IDE and it makes it's own folders. If I move files around after I save it, it doesn't work when I reopen it and automatically resaves it where it was and I end up with all these weird duplicate files and folders.
Question 2: Do I need to be working in some other editor when creating a library?
Thanks!
The file in your folder should be:
Librairies/
Morse/
morse.cpp
morse.h
keywords.txt

Code completion for Eigen library doesn’t seem to fully work

I just started using Eigen 3.2.0 on QTCreator 2.8.1.
All is well but code completion only seems to partially work – I get a bunch of options, but many are missing. Here’s a screenshot of an uber simple code snippet – as you’ll see, the list of available functions for m0 is limited (e.g. block() and col() are missing but cols() is there).
However, all of these functions seem to be usable – the code compiles and runs properly. This is a problem, given that Eigen has a lot of functionalities, and I’m nowhere close to remembering the name for all of them. I tried a bunch of random things, but am not quite sure what’s going on. Here’s the code from my .pro project file, in case
QT += core
QT -= gui
TARGET = LearnEigen
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH += ..\..\Libs\Eigen
Would be forever thankful for any advice or pointers to other threads that may have addressed this.
thank you!
Long time since your question, but for anyone may want this problem to be solved, take a shot to the following option:
Go to Help-> About Plugins... -> enable ClangCodeModel
Restart Qt Creator. Check that it got activated; Tools -> C++ -> Code Model
problem solved!.

Compile Finite State Machine to UML(-like) Diagram

Every Python developer knows tools like Sphinx. You write some text in a markup language, write make in the shell and let some compilers do their job. In the end you get beautiful HTML or PDF.
I am looking for something like that, just for Finite State Machines, e.g. I put SCXML into a file (with a GUI or manually with VIM as I desire) start a compiler and out comes a picture file format that i can use however I please and that looks good even if I don't know what I am doing. Example:
$ vim my-fsm.scxml
$ scxml2svg my-fsm.scxml
writing file...
finished writing my-fsm.svg
$
The closest I got so far is using various Eclipse plugins (years ago, dislike huge IDEs), draw.io or what I am using now: Umlet. Even Umlet has problems, though. For example it doesn't support the workflow I am used to (write text files, start compiler, see beautiful result). The results are often also suboptimal, because the engine is actually quite simple. But everywhere I look for a more useful alternative (python wiki, other SO questions, tools) I still don't find a simple compiler.
Now I would be really happy if anybody would know such a compiler. If not possible a FOSS GUI editors with PNG/SVG export would also be okay.
GraphViz has a file format which can be written manually and compiled to different picture formats.
I wrote some tools to do this: http://goo.gl/V97ft

auto complete for Qt in emacs

I have become addicted to emacs and have been using it for everything. Now, I have started Qt4 . I am forced to move to the Qt Creator because of its auto complete feature which is required when writing programs in Qt because of the heavy use of pr edefined functions in it.
But the problem is that I don't want to leave emacs. Is there any way to get a auto-complete feature close to that of Qt Creator in emacs.
I have installed the CEDET-1.1 where I discovered the text file for c++ which contains all the commonly used c++ keywords. One way could be to add Qt class and function names in that file which gives me a pretty basic auto complete for Qt. But can I get a better auto complete?
Do not use cedet anymore, it is big, and slow.
I recommand you use https://github.com/brianjcj/auto-complete-clang, which is lightweight, and much easy to use. All you need to do is to learn and configure of auto-complete and yasnippet.

Ada: plotting 2d graphs

it would be interesting to be able to plot a 2D graph within an Ada code rather than having to save values say to file and use an external drawing software afterwards. A search on the web has taken me to two packages: Win_IO and JEWL. I have been able to use WIN_IO though but the documentation is quite poor and having just started using it, it seems that it is not possible to resize the size of the canvas. I use the GPS editor and I get complaint when running Win_IO that some fonts are not available on my system and that the output will be ugly. Finally the plot doesn't itself pop up on the screen; One has to click on the exe file of the file being compiled and linked so as to get the graph.
I have taken a look also at JEWL but it doesn't seem to be able to plot graphs.
Are there more Ada packages available out there for plotting 2D graphs.
Thanks a lot...
My experience with GNAVI:
The installation instructions are at
http://www.gnavi.org/index.php?Command=Class&ClassID=Start&CID=381
Basically the installation consists of:
To use:
Place this directory on your path
cd to gnatcom and run: make install
cd to gwindows and run: make UNICODE=1 all
run: gnavi_ide and enjoy :-)
But the installation is plagued with errors:
C:\gnavi\gnatcom>install
Installing GNATCOM.....
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
Error makefile 2: Command syntax error
* 1 errors during make *
Install Completed
C:\gnavi\gwindows>make UNICODE=1 all
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
Error makefile 2: Command syntax error
* 1 errors during make *
And though C:GNAVI is on my path, the IDE still complains that icg.exe which is found in C:GNAVI is not on the path.`This is trouble with software which has not been fully tested!!! I was very disappointed that people can write irresponsible and incomplete installation instructions. Have the developers even found out that whether a normal user can install their software?
I have also try to look at AdaDesigner at https://gna.org/projects/adadesigner
Here, FireFox complains: This Connection is Untrusted
gna.org uses an invalid security certificate.
The certificate is not trusted because the issuer certificate is unknown.
I decided not to visit such a website.
PLplot is a cross-platform package for creating scientific plots. It has a well-documented Ada binding. For reference, this gallery illustrates a variety of plots. Click a thumbnail to view a full-size image. Click either Ada tab (standard or traditional) to see the corresponding source code.
I'd give a try to GTKAda. I'm not completely sure this subsystem would allow you to do 2D graphs as I've never used it for that purpose, but it can be done with GTK+ (C/C++).
There is also a guide on GTKAda and a reference manual, some documentation on the GTK toolkit itself may also come handy.
It depends on exactly what you want to do. For graphing node-based diagrams, the first thing I'd look into using is Graphviz. It has its own special graphing language it uses, but I'm all about using Domain Specific Languages when appropriate. Ada has great interoperability, so using DSLs with it can really make it powerful.
An example I found is AdaDesigner, which generates Graphviz DOT files to help visualze the structure of Ada code.
The one time in the past I had to do simple plotting, it was for a web app. I ended up dynamically generating SVG pages on the server side (even though it was poorly supported then). Support is better now, so I'd definitely use it again today.
If working directly on a Windows PC display appeals more to you, there are several options for GUI bindings, all of which should support drawing lines and points on a canvas. In addtion to GTK (which is both powerful and portable), there are a few Win32 API's floating around. I think one comes with Gnat. Another you might not be aware of is GWindows. It is part of GNAVI, which aims to be sort of an OpenSource alternative to Delphi. It isn't the most active of projects, but is (reportedly) quite useable, and is still being worked on and used. Here are some screenshots of it being used for plotting.
(source: gnavi.org)
MathGL is cross-platform GPL plotting library. It have C interface, so you can use it from yours code too. Also it can create a window with graphics -- i.e. you don't need to study/use other widget libraries in simplest case.

Resources