RC Fireworks Ignition System

Hi there 🙂

It's been kind of a while since we published the last article. Actually the topic of this one is pretty cool and can be used for many purposes such as mole hunting 2.0 :D.

So everything started with an idea. A simple idea. "Hey! we should drop fake bombs from our R/C plane!". Then, "Hey, smoke would look great on this R/C plane!", and finally, "Hey! We should launch fake rockets from our R/C plane!" (and yes, we are grown up people with employement... 🙂 )

We started doing it by hand, firing the smoke and the firecrackers with matches just before to take-off. It was nice, but we had to hurry and we could not decide on when the smoke/firecracker should be launched.

The principle

After looking on the Internet for automatic ignition systems, we came up with our personnal DIY system, which, while not perfect, gives pretty neat results!

There isn't that many options to automatically light a firecracker's wick:

  • We can use the principle of a lighter, that is, having an embedded tank of flammable gaz, a system to generate a sparkle, and an automatic valve.
  • Or we can use a thin steel wire and put a large current run it so it would become incandescent.

 

The first solution would involve a too complicated system for the sunday DIYers that we are. Also, we were not sure how it would behave with all the relative wind there is on a plane. We decided to adopt the second method.

To have a reliable and effective ignition system, the key is to reach a temperature that would effectively light the wick, but not TOO hot in order not to destroy the wire or even the plane's battery.

First version

The coil

So we started by using a wire that came from a stranded wire (itself coming from an old computer power supply unit). We took 3 or 3 strands, twisted them, cut around 10cm (4inches) of it and shaped it as a coil around the wick. then, we put our protective glasses, gloves, and put the power. the coil instantly melted, ligthing up the wick! So it worked 🙂

This coiled cooper wire, when a hight enough current flows through it, get very hot and burn.
This coiled cooper wire, when a hight enough current flows through it, get very hot and burn.

The switch

We only had to find a way to put the power when the plane was in the air. That was a tricky question because in an R/C plane even if you have a very powerfull battery that can provide 300 or 400W easily, you still need a switch that will withstand this kind of power. But in a plane you also have the PWM output of servos comming from the R/C receiver. Several solutions here : the most aesthetic one is to buy/design an electrical relay that is triggered by a channel of your R/C controller. but as I said, we where in a hurry to make this plane in the air, so we opted for the most epic switch ever: a servomotor with hot-glued wires on it that make contact when we trigger a channel on the transmittor. Effective, very ugly, that was perfect!

A really basic servo switch that is used to enable current flow through the ignition system.
A really basic servo switch that is used to enable current flow through the ignition system.

So it worked like this for a few flights, with the obligation of crafting a new coil for each successful ignited firework. kind of boring after a few ones... So we decided to improve a little the system.

The improved version

Basic physics..

I had some steel wire remaining from an old project (a hot-wire cutting table to cut airfoils out of foam blocks). I knew that it could become very hot without breaking by experiment it back then. So we first got some wire, and measured the electrical resistance per meter which was around 10ohm per meter. Let call it Rw.
The resistance of a wire is proportionnal to its length. So we have:

R=R_w*L


By experimentation, we also knew that a power of around 100W would do the trick : it's enough to provide very big sparks, but not enough to damage the battery and to reduce the autonomy of the plane. So to calculate the length of the wire we need, it's really easy physics :

it's a simple resistive circuitry, so we have the famous

U=R*I \to R=\frac{U}{I}


Also the power consumed is given by

P=U*I \to I=\frac{P}{U}

Injecting the ohm equation gives us

R=\frac{U^{2}}{P}

We inject the very first equation giving us

R_w*L=\frac{U^{2}}{P} \to L=\frac{U^{2}}{P*R_w}

Only very basic math and physics here. Applying it to our problem gives us (the average voltage on a plane that is flying with mid throttle on 3S is 11V).

L=\frac{11V^{2}}{80W*10\Omega/m} \approx 15cm \approx 6inch

On the Bixler...

That is a neat result because it allows for a small enough wire to be shaped as we want to make it easier to lock the wick. We decided to cut it in half and put it each side of the Bixler's wing. We cut a can and glued it to protect the wing from the rocket's projections. We also doubled the circuitry with 2 switches to have another ignition system to light up smoke 🙂

The tail of the rocket is inserted inside the plastic tube, and the wick is holded inside the wire's loop.
The tail of the rocket is inserted inside the plastic tube, and the wick is holded inside the wire's loop.
The smoke bomb is placed in the hole, and its wick is holded inside the wire's loop.
The smoke bomb is placed in the hole, and its wick is held inside the wire's loop.
We can see the rocket that is holded inside the plastic tube with tue wick pinched on the hot wire.
We can see the rocket that is held inside the plastic tube with the wick pinched on the hot wire.

Here is an amazing video demonstrating the rockets and the smoke bombs, it also features some night flights with the Bixler 2!

T-Rex 700L Dominator

Hey there !
It's been a while since the last article... So let's talk about something big this time. something really big. REALLY. The T-REX 700L Dominator, a class 700 (rotor size of about 1.6m, 5kg) helicopter made by Align. If you remember, I started to fly helis with an other Align helicopter, the T-REX 450 Sport V2. We remember beeing very afraid of it when the rotor started to spool up for the first time. Let me be clear, this T700 has NOTHING to do with it.

IMG_8238

So, from a technical point of view, this 700 heli is the most advanced version of the T700E, first 700 electric heli made by align of this side. It features the last upgrades of the frame, BL815H and BL855H brushless servos, the 800MX Align motor, a Castle Creation 120A ESC and the DFC rotor head. The stabilization control is done by the new GPro controller (formerly known as 4GX)

IMG_8212Disassembled DFC head

IMG_8221The Cyclic BL815H brushless servomotors

IMG_8219The huge 800MX Align motor.. A real monster !

The built is really straighforward and you just have to follow the manual :). Beware to threadlock all the metal-to-metal screws and VERIFY it's well locked ! I crashed because a servo screw became loose... 🙁

IMG_8215The frame beeing assembled

IMG_8216

As I said, it comes with the latest "inovations" from Align, so you have two helicoidal gears wich make a really nice sound once in the air 🙂
IMG_8915

IMG_8230the DFC head

IMG_8225Close-up view of the motor and servos

IMG_8232Almost ready to fly here

IMG_8228Tail and servo tail

IMG_8916View of the implentation of components

As I didn't have (still don't) a High Voltage receiver, I had to think a little about electronics in this bird. This is the wiring I used to power the servos with HV source (2S lipo = 8.4V fully charged), and feed the receiver with a safe 5V.
Electro_T700Electronic wiring

The BEC component is actually in the T700L Dominator kit, good point for Align (again) :-D.

IMG_8908Tail assembly details
One word about the CC 120A ESC. When using lower head speed (<1800RPM), the CC tends to get very hot (above 100°C). This can lead to the destruction of the device. I wanted to put a 1500RPM head speed at first but changed my mind after seeing that. 1850RPM works fine for me. As you can see in the next picture, I put the controller on the rear of the frame, which is excellent in terms of heat because we have a giant propeller above it that helps to cool it down 🙂 IMG_8904

IMG_8910

Setting the GPro up is really a piece of cake, we can see Align really cared about the ease of use for this device. It comes with a free software for PC, Android and Iphone users! Note that for the phones, you have to buy a BlueTooth device separately.

IMG_8917GPro unit

As I could expect, it flies REALLY well, and the FBL head is quite amazing at all head speeds I tried (from 1500 to 2100).

Stay tuned ! More posts will come soon.. I hope 😀

Getting started with the Raspberry Pi : From the box to SSH

Guess what's in the box ?
Guess what's in the box ?
Hi there !

In this article, we'll discuss about the famous Raspberry Pi, a tiny and cheap computer. You can get one for around $30 and it has a credit card size. The whole thing is run by a 700MHz ARM-based SoC ,assisted by 256MB of RAM (512MB on recent models), 2 USB ports, an ethernet port, both HDMI and composite video output and a SDcard slot where you basically put your OS. It's powered via a micro-USB input (5V @~700mA).

The Raspberry Pi PCB
The Raspberry Pi PCB

When you receive your Pi, first thing that comes in mind is "gosh it's tiny !". Indeed, this credit card size is quite astonishing for a computer, even if you are used to deal with Arduino and other PCBs of the same size. Fact is that you have here a fully capable computer on which you can put a Linux distribution, decode 1080p videos and run "reasonably powerful" programs. Let's try this little piece of silicon.

Global purpose I-O pins, allowing hardware to be connected to the Raspberry
Global purpose I-O pins, allowing hardware to be connected to the Raspberry
Basically, all the information you'll need are gathered here : http://www.raspberrypi.org/. You'll only need a SD card (4go is fine, 8Go is good), and an other computer with a SD card slot to burn your OS.

First thing to do is to download the burner : Win32 Disk Imager. Then download an OS that is compatible with your Raspberry. I strongly encourage you to choose Raspbian “wheezy” if you never experienced Raspberry before. It's a Linux OS based on the Debian distribution.

Then you'll have to burn this. Open Win3D Disk Imager, select your distribution, and write it to the SD card. The process can take several minutes. When it's done, just insert it into your Rasp slot, and it should do the trick.

diskImager

To start using your Pi without a display, you can use putty and SSH to remotely take control over your Rasp. All you have to do is connect your Rasp to your local network, download PuTTY and connect to the default name of the Raspberry : raspberrypi (or its IP address).

putty_connect

If you see (after  a possible warning message ) a console that invites you to enter a login, your Raspberry is OK and connected ! If not, check again if you're connected to the network.

command_invit

Enter the default user : "pi" with password "raspberry" (without double quotes). You'll have a prompt that indicates you are now able to type commands over your raspberry. Before doing anything, type the following command :

sudo raspi-config

Select expand_rootfs so your raspberry will use your whole SD card memory. You can also overclock it up to 1000Mhz (I did it without a problem). Reboot your raspberry as asked.

raspi-config

Now, want to see more ? You can use a protocol named VNC that allows you to launch a desktop interface on your Raspberry over the network. Reconnect to your Pi and use this command to download a vnc server :

sudo apt-get install tightvncserver

then launch a server with the command

vncserver

You'll be prompt to enter a password.

If you're on Windows, download VNC Viewer. Once you get it, launch it and select as VNC server "raspberrypi:1". Then hit the connect button and see the magic!

vnc_connect

vnc-connected

From now on, you are able to remotely use your Raspberry and start thinking about all the applications it has! For example, you can use it as a file server by installing a samba server (which is really easy), as a media center with the well known XBMC... This is totally up to you!

Flashing a Turnigy 9x with an Arduino

Don't you think those programmable transmitters are really expensive ? Well here is one solution to this problem : If you already have an Arduino, some wire, a soldering iron and a litle bit of dexterity, you can have a complete, highly customizable transmitter !

Indeed, some awesome guys made new firmwares for the "well known" Turnigy 9x (a low cost 9 channels transmitter, about $60). Even better, those projects are opensource and free. What else ? Ok lets start this little hack.

Turnigy 9x

There are numerous projects (TH9X, ER9X, GRUVIN9X, ERSKY9X,..) and the choice is up to you. I personnaly used Open9X because it seems to be the better easy-to-use/fonctiunalities ratio. But before talking about software, lets discuss the hardware. The problem is, how to send the new firmware to the radio ? Actually this is where you'll need to solder a little. It can be pretty scary, but it's not that hard if you have a good iron ;-).

Lets add a programming port to your 9X !

[important]If you purchased a "9XR" version, there is no need to to this hack since it's already done in factory ![/important]

The Freshly bought Turnigy 9X

Ok you said goodbye to your beloved radio ? Let's unscrew it ! Note that on mine the screws were really hard to unscrew, and I had unfortunately to destroy one of them. Once i'ts open, you'll first be like "WTF am I doing?". Actually, it's pretty simple. First thing you have to do is disconnect the connector that goes from the front part to the back part. After this you'll be able to separate them. On the front part, locate a "big" chip. It's the heart of this radio, the ATMEGA64. Pretty simple stuff, actually. It will be easy to reflash thanks to the AVR isp (In-System Programming) protocole. You'll just have to add the wire to be able to use that protocole.

Atmega64, heart of the system

You'll need 6 wires for the isp protocole :

  1. MISO (Master In Slave Out) known as PDO (Program Data Out) on the chip
  2. Vcc (5v)
  3. SCK (clock signal)
  4. MOSI (Master Out Slave In) known as PDI (Program Data In) on the chip
  5. RST (Reset)
  6. GND

You can figure out by yourself were you should solder those signals reading the ATMEGA64 datasheet (pin n° 2,3,11,20,21/52, 22/53) but I'll give you a simpler way to solder it : Actually the designer of this board were cool guys, the little pads you can see can be easilly used as entry point to solder your own wires.2013-01-01 16.40.50+annots

Pretty easy, isn't it ? I strongly recommend you to make an interface to the outside of the radio because there are several softwares that allow you to customize your model on your computer and then transfert the result in the radio memory, using this protocole. I personnaly used a DB9 connector. but you can use whatever you want (it must have at least 6 connections). The better place to put this connector is under the radio so your hands won't be disturbed.

2013-01-01 17.08.29

2013-01-01 16.41.06

Ok you can now close your radio (don't forget to plug the 12 wires connector). Try to turn on your radio. If it works, lets go to the next step!

Turn your arduino into a AVR programmer

From here, you can use every AVR programmer you want that is compatible with AVRDude (that is, almost every programmer, actually). But I hadn't one and I knew that the Arduino could be used as one. Here is basically the schematics you want (leds are optionnal but strongly recommended. Also, the PCB should not be really hard to design and make).

Untitled Sketch_bb_corr_1.01

Note that the reset is tied to Vcc to prevent reset when connecting the Arduino.

Double-check your connections between the ISP and the ATMEGA64, if you don't want to buy another 9X 🙂

The Scketch to upload to the Arduino is located under the examples as "ArduinoISP". This is actually an implementation of a subset of the "STK500" protocole  (learn more here), and therefore you'll be able to use it with Avrdude (which is nice because that's what we need to easilly flash our 9x !).

Pin assigment is given in the sketch :

// pin name:     not-mega : mega(1280 and 2560)</div>
// slave reset: 10        : 53</div>
// MOSI:        11        : 51</div>
// MISO:        12        : 50</div>
// SCK:         13        : 52</div>

[notice]

Because of the ATMEGA64 EEPROM address managment, you have to make 2 modifications : when reading the EEPROM and writing the EEPROM : the code looks like it :


uint8_t write_eeprom(int length) {
// here is a word address, get the byte address
int start = here * 2;

and


char eeprom_read_page(int length) {
// here again we have a word address
int start = here * 2;

You have to delete the "*2" since the address is already a byte in the ATMEGA64.

[/notice]

The Firmware

Just install the Companion9X software that will do everything for you. Just change your programmer option under Burn/Configure... and enter the following :

conf_avrdude

(The Port is the port representing your Arduino)

Ok, time to flash ! You can download whatever version you want and try all those wonderfull firmwares !

2013-01-02 15.49.34

2013-01-02 15.51.34

I hope this little tutorial has been usefull for you 🙂 Stay tuned !

Crash T-REX 450

Hi all ! As we're enjoying a very bad weather for a few weeks now, i'll use this time to share some pictures of my first crash with the T-REX 450. This one was due to the big distance of the heli and a grey sky (I lost the orientation). The crash were pretty bad mostly because I panicked and forgot to stop the engine.. Any way 40€ latter it was back in the sky !

2012-09-27 18.06.35 2012-09-27 18.06.45

2012-09-27 20.02.17

As you can see, the main shaft was bent pretty hard..

2012-09-27 20.02.29 2012-09-27 22.09.18 2012-09-27 21.44.03

All the broken parts..2012-09-27 20.02.39

Stay tuned !

A max7456 library for Arduino

It's been a while since we published the last article.. Well we've been pretty busy those days but as a gift in this article I'll present you some of our lattest work : A library for the well known max7456 chip by Maxim.

As famous as it is, a little reminder won't be too much. max7456 is basically used to insert customized information in a given analogic video stream. This manip is called "OSD" (for On-Screen Display). A little picture to explain it :

explainationOSD

We recently bought a wireless video system in order to do FPV (First Person Flying, you only look on a video send by a camera installed on the drone/plane). And the problem is that it's quite hard to pilot this way without additional informations about the flight. So we decided to make our own OSD system.

We decided to make a library for the max7456 because we didn't found one that fitted our needs. This library is pretty simple to use and comes with a complete documentation and example programs. This has been used with a PAL system, but the differences with NTSC are not really big (you have to init it an other way, refer to the datasheed of max7456 if you need to).

Here is the Hello World ! code :

#include "SPI.h"
#include "max7456.h"

Max7456 osd;

void setup()
{
  SPI.begin(); //to be called before osd.init
  osd.init(10); //CS on port 10
  osd.setDisplayOffsets(60,18);
  osd.setBlinkParams(_8fields, _BT_BT);

  osd.activateOSD();
  osd.print("Hello world : )",1,3);
}

void loop()
{
}

In order to make easier the process of entering new characters in the NVM (non-volatile memory) of the OSD, I made an program used to transform a bmp picture representing the OSD characters table into a single array you can use with the library (there is an example that shows the use of this array). Just lauch the executable with the options :

[source lang="shell"]convertOSD.exe -i ".bmp picture" -head ".h containing array"[/source]

The bmp picture looks like this :

tableOSD

This represents the 256 characters to be insered into the NVM. So here's the deal : when you want to put your customized characters table into the NVM, you must write on a register in the max7456. The values to write on this special register are directly related to the character. To be quick, each pixel of a character is 2-bits coded, and the character is 12x18 pixels you'll need 54 bytes of data. There are 256 characters in the table so the array returned by the program is 13824 bytes long (approx. 13.5k) . This is much more than the Arduino's flash memory can handle (2k). But the program memory is sufficient to store such an array. Then we used a little trick to program the max7456 in one single operation : we simple store the array in the program memory with the instruction :

const prog_uchar tableOfAllCharacters[13824] PROGMEM = {0x55,0x55,0x55,0 // ....

Nothing really hard here : character at address 0x00  is represented by the 54 first bytes, character at address i is represented by the (54*i) next 54 characters. Note that all the 0xFF value has been replaced by "0x55". This is because af a tricky bug in the Arduino bootloader that causes the Arduino to be corrupted if too many 0xFF are sent on a row to the program memory. Therefore, this is the method to get the character i in the table "table" (we fill a special type "charact" which is in fact a 54 bytes array.


//-----------------------------------------------------------------------------
// Implements Max7456::getCARACFromProgMem
//-----------------------------------------------------------------------------
void Max7456::getCARACFromProgMem(const prog_uchar *table, byte i, charact car)
{
	unsigned long index;
	byte read;
	index = i*54;
	for(unsigned long j = 0 ; j < 54 ; j++)
	{
		read = pgm_read_byte_near(table +index+j );
		car[j] = read;
		if (car[j] == 0x55)
			car[j] = 0xff;
	}
}

Note that we experienced problems with the sparkfun max7456 package. This was caused by a chip overheat dued to insuficient copper pad under it. We solved the problem by adding a tiny RAM heat dissipator on it.

Ok, most important part now : the sources !

Character array generator

Max7456 Library

Align's T-REX 450 Sport v2

Ok, so after flying with our quadrirotor, I wanted a machine capable of doing a more aerobatic flight. So I started looking at CP helicopters. A CP (Collective Pitch) helicoptere is a particulare type of heli that is able to independently move its blades. For instance, the two blades can take a positive pitch which will sustain the helicopter in the air, or it can give a different pitch (Called cyclic pitch) regarding the position of the blade, to make the helicopter move in a particular direction. See this Wikipedia page for more informations about it.

So, after a while, I decided to buy a class 450 heli (rotor diameter around 700 mm), mainly because of the low price of this class and also for the ease of use (and also, it's less dangerous than a 700 with a rotor diameter of 1m50 !). I bought the TREX 450 Sport V2, as the Align brand has a really good reputation among the Internet.

The box arrived 10 days after shipping, and my first impression was : that's a very tiny box !

Everything inside this box is tidy.

Let's open all those sub-boxes, to discover that there is a significant number of parts 😀

One great point with this kit, is that it comes with the electronic (motor, ESC, servos) and i had to add my newly converted to 2.4Ghz Eclipse 7.

Let's now have a look to the assembly. I knew what to expect here has I read a lot of things on the Internet about it. Clearly Align masters the subject and the assembly is really straightforward.You just have to follow the manual. Don't forget to double check if the pre-assembled parts are well threadlocked.

Head assembly

This is clearly a masterpiece, it's beautiful and there is no backslash. the only (related) problem is that the links are tight so you have to lapp the plastic screeds. Here again, it's really well documented on the Internet. On the pictures, you may have noticed that I inverted the main shaft. Be careful or you'll have a big backslash between the frame and the head.

Let's now have a look on the carbon frame assembly.

Nothing to say here, just follow the manual :-)Oh, just, don't threadlock the rear screws (where you insert the tube) as we'll need to loose it to put the tube and adjust the tension of the belt.

Let's focus on the AC assembly. Almost nothing to do here for me as it was well locked from factory.

A little word about the main gear : to adjust the backslash between the motor and the main gear, one tip is to insert a piece of paper between the teeth, so there is around 0.1mm between them, as given by Align.

Last part of the job before the adjustments : the electronic. Just screw the servos, make them horizontal when the TX is at neutral, and it's done ! Also put a little strip of foam between the frame and the gyro to absorb vibrations.

Annnnnnd it's done : it took me two days to do it, but it was the first time I did it ! I think I would take 5-6h now to assemble it again.

Later we'll talk about the first flights, maintenance, and the first crash I had after 50 flights ! Stay tuned 😉

How to compile Stellarium with a Windows seven 64bits platform, and how to make it a fully redistribuable package

This is what you shoul'd be able to do at the end of this article

In this article, I'll assume that you're familiar with c/c++ and Qt. if not, there are plenty of complete tutorials and resources on the Internet.

As we wanted to modify Stellarium's telescope plugin to make it fit its use with Picastro, I was kind of afraid for Stellarium compilation. As you may know, it's often difficult for the average joe to compile open-source softwares, especially when no documentation is available. By chance, there is a lot of documentation for Stellarium. The bad part is that it's kind of out-dated, so you'll need to put your hands in dirt areas. Nothing impossible, through.

Download all the things !

The first thing to do is to get the Stellarium source code. Two ways are possible, depending on what you want to do. You can first download the current release source code, which is stable. Or you can download the "under development" source code. You'll conveniently use a CSV soft, Bazaar, to do this. To retrieve the updated version, you should go to the official web site  . Click on Linux (Source), for the current version 1.3, will give you a link to the sourceforge project.

The second thing you'll do is to get the software QTCreator.  Even it's not your favorite one, I didn't find an easy way to pass through it. (for example, you can't compile it with Microsoft Visual Studio compiler, since there are parts in the Stellarium source code that aren't compatible with this compiler). But as you'll probably see, it's a pretty nice IDE. Download the whole SDK, including the desktop compiler for QT, this is the one that will be used to compile stellarium. Install it under its default path (C:\QtSDK) and choose a custom installation. Under Development tools, only select the last Desktop QT for MinGW compiler. You can select the documentation of Qt as it will be a nice help if you're unfamiliar with Qt development process.

Then, there are 4 open source softwares you'll need for compiling stellarium, which are:

  • CMAKE , that will create the project. It's not really a compiler, it only tells QTCreator how stellarium's code source is organized so QT compilers can do their job. Notice that in the official wiki, it is said that you can't compile directly on a win7 64b plateform directly, and that you must use a virtual xp computer. This information seems to be out-dated, as I was able to compile on my 3 Windows 7 64b computers. Just install Cmake in the default directory, and choose to add Cmake to your path.

Then, you'll need the 3 following softs, which are dependances for Stellarium (if you miss-installed them, you'll get an error at the CMAKE step). Those softs are :

  • GETTEXT, for translating purpose,
  • ICONV for character encoding conversion purpose,
  • ZLIB, for compression purpose.

You should install the three last softwares on the same folder where the mingw compiler is. For me, it's "C:\QtSDK\mingw". Then, you must tell your computer where are all those compilers by adding to the PATH environment variable the path to needed binaries and include files (of course this will depends on the version of Qt you get):

C:\QtSDK\mingw\bin; C:\QtSDK\mingw\include; C:\QtSDK\mingw\lib; C:\QtSDK\Desktop\Qt\4.8.1\; C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin; C:\QtSDK\Desktop\Qt\4.8.1\mingw\include; C:\QtSDK\Desktop\Qt\4.8.1\mingw\lib;

Setting up a Stellarium project in QTCreator

Ok then, launch QTCreator. open CMakeList.txt at the project's root (File/Open File or Project...). As it turns, QTCreator recognize this file "to be the descriptor file of the whole Stellarium project.

The Cmakelists.txt you should use

You can select a build location, to keep your source code clean. You'll also be asked to select a project compiler : Select the default one (MinGW Generator (Mingw as a GCC for Windows targets). Launch the project creation ("Run CMake"). If there are errors here, make sure you didn't forgot any step described above. Verify the different paths (bin folders must contain exe and dll files, include header files, and lib .lib, or .a files. Some error can appear, but if nothing turns red, its OK.

Some error can appears during the process

You now have to say QTCreator that your runtime environment is the project's root. To do this, go under the Projects tab (on the left side of the Window), and got to the runtime parameters tab. As a folder repertory, put the folder where you unzipped the Stellarium sources.

Settings for the Stellarium runtime

After this, you should be able to build the project (Build/Build project "Stellarium") You'll see in the "Compile Output" the process details. There are lot of warnings you shouldn't be afraid of. You can launch your project (Build/Run). Now is the time when you are very happy to see your own Stellarium compilation running !

About debugging : The most annoying thing about this is that I wasn't able to find a way to use the debugger with Stellarium. Anyways, there are plenty of tools in Stellarium that allow you to write messages or TextBoxes to debug in an "old school" way. If you know a way to use a debugger, I'm really interested ...

Distribute your work

So, you made a very nice static plugin and want to distribute it to your friends or even the rest of the world ? Nothing easier. First you must have launched QTCreator as an administrator. Then, under the Projects tab, in the Compilation parameters, add an argument to the existing compilation step (mingw32-make.exe) , "-install". This will install your freshly compiled Stellarium under the program files folder. Next thing to do is to download inno setup, in order to package the whole thing. So open Inno Setup, and Open a New Script File. Use the stellarium.iss script (you can find it at the root folder of the sources). This is an auto generated file (at the CMake step), but in my case, this file has a little problem. Two lines are corrupted and need to be changed manually (don't worry, it's not really hard as it's just a problem with two files paths. You'll have at the end a very nice installer file easy to share.

How to add a console to your Serial port in Eclipse

I didn't find any way to make a console work efficiently with my fresh "Eclipse for Arduino" installation, so I decided to find a work around to launch it. First thing is to get PuTTY. Then, put this little bash file I made wherever you want (the file extension must be .bat).

[source lang="bash"]

@echo off
REM Check for user inputs
if "%1"=="" GOTO BadArgs
if "%2"=="" GOTO BadArgs
if not exist putty.exe GOTO BadPuttyInstall

REM Local variables.
SET PUTTY_SETTINGS=ArduinoSettings
SET COM_PORT=%1
SET /a BAUD_RATE=%2

REM Modify registry keys for modifying the putty settings.
@REG ADD HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\%PUTTY_SETTINGS% /V SerialLine /T REG_SZ /D %COM_PORT% /F > NUL
@REG ADD HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\%PUTTY_SETTINGS% /V SerialSpeed /T REG_DWORD /D %BAUD_RATE% /F > NUL
@REG ADD HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\%PUTTY_SETTINGS% /V Protocol /T REG_SZ /D serial /F  > NUL

REM Load the setting with putty.
echo Launching Serial console (PORT %COM_PORT% ; BAUDRATE %BAUD_RATE%)
putty -load %PUTTY_SETTINGS%
echo.
goto EndProg

REM Error management.
:BadArgs
echo.
echo Problem with number of arguments. For example : COM3 9600 ; COM2 115200.
goto EndProg

:BadPuttyInstall
echo.
echo Could not find Putty. Make sure that the working directory contains it.

:EndProg

[/source]

(Be aware that this script makes modifications in your registry, so make sure you know what you do).

Next we'll integrate it into eclipse.Go to Run>External Tools>External Tools Configuration. Create a new configuration. In the main tab, in location, indicate the path to your bash file. As a working directory, select your PuTTYdirectory. As arguments, put first the name of the port you want to connect to, and then the baudrate (for example you'll have COM2 9600 ; or COM12 115200). In the "Build" tab, uncheck "Build before launch".

You can launch this by clicking on the icon next to the "Run Project" (it's a little green arrow with a brown toolbox).

If you want to change the console color/aspect (typically, I like to have it in front of all other windows), just run PuTTY, load the "ArduinoSettings" settings, modify it as you want, and save it.

Hope it will be usefull !

How to use Arduino with Eclipse

Complete explanations : http://eclipse.baeyens.it/

Why changing the IDE

If you're familiar with the Arduino IDE, you will agree that it's not very convenient to use. For exemple, you won't be able to do multiline tabulation, autocompletion and advanced programming tips in general. Well here's the good news : you can use a very powerful IDE, Eclipse (well known by Java developers) to make your Arduino developpements. This article is meant to help you doing this.

Downloads

First, download the Eclipse IDE. Be sure to choose the C/C++ version, not the Java's one.Then, you need to download the Arduino IDE. It will get you access to the compiler and the core libraries.

Configure Eclipse

The first thing to do is to launch Eclipse IDE.If Eclipse tells you that JRE is missing, you'll have to install it manually. If you are running Windows 7 64bits, download the specific 64bits version of this JRE, otherwise it won't work.

After Eclipse has started, you'll be prompted for a wordspace folder, select wherever you want to save your future projects. Personnally, I've a root folder "EclipseForArduino" where are located Eclipse IDE, Arduino IDE and my workspace.

Ok, now you have to install the Eclipse extension for using AVR compilers. Go to help>Install new software. In the "Work with: " field, type http://www.baeyens.it/eclipse/update site/, and then select the Arduino eclipse extensions software. Install it, then restart Eclipse. You'll have a new menu item "AVR". Lets configure it with Window>preferences, Arduino tab , Arduino>Arduino Settings for this workspace. Put your arduino IDE (for me : D:\EclipseForArduino\arduino-1.0.1. Check "Use Arduino IDE tools in eclipse".

Click Apply, and go to the "Paths" tab to check if everything's ok (except for the last one, which is not important).

In AVRDude, the "Use custom configuration file for AVRDude" checkbox must be checked, and filled out with the avrdude.conf file from Arduino IDE.

OK, now you should be able to create a new project : File>New..>Other.. ; select Arduino>New Arduino Sketch. You'll have to select your serial port and board revision.

To avoid problems while using Serial ibraries (typically, Eclipse says there are bugs when you use Serial, but you still can compile it) :

windows->preferences->C/C++->indexer->index unused headers.
windows->preferences->C/C++->indexer->index source and header files opened in the editor.
windows->preferences->C/C++->indexer->Files to index upfront . Add arduino.h and or WProgram.h.

To import a library in your project, simply right click on it, then select "Import...", and "Import a arduino library in the current project". That's almost it. If you have some problems, first review the official plugin support site (I gave a link to it at the beginning of this article).

Export/Import your Arduino project

How to import an existing project, lets say, to an other computer ? First there are 2 prerequisites to make it possible :

  • The needed libraries must have been placed in the folder specified under plugin preferences
  • In additiont o the sources, .project and .cproject files must be present in the sources folder. Without those files, you'll have to manually import the needed libraries.

The steps of import procedure are :

  1. In Eclipse, choose the existing project import.
  2. Check that the plugin is well installed. The included libraries must be in the good folders (check both core and personal libraries)
  3. If the board you want to use is not il your existing projects, create a new Arduino project to generate it. You can next delete this newly created project as the board project wil stay.
  4. Under project preferences, Arduino tab, select the newly created board.
  5. Import is now over. One can continue to work on the project.