Latest on twitter from msanchezmora 
  • loading...

Arduino (0022) problems coming from String and Serial libraries

Posted: December 20th, 2011 | Author: | Filed under: Arduino | No Comments »

Arduino Home Website: String Object

When you start working with Arduino, you can find all the official libraries available at Arduino home page, the String and Serial are some of them.

In my last project (see my past posts Like Box or Boards are ready), I was using Arduino alpha version 0022. At the beginning everything was ok but when I started doing more complex stuff such as: concatenating strings, reusing string objects, assigning one string to another and overall leaving my app working for few hours…then serious memory leaks and corruption problems were happening. Programming with Arduino processing is particularly sensible to memory problems mainly because the loop() function is continuously running, so string objects are continuously being reused, resized, etc..

In order to have a more precise control of memory usage in my Arduino application I decided to use classic C language dynamic char arrays. For a programmer with extensive background in C language this was the shortest solution. Searching on google I realized I was not the only one having this problem so hopefully next Arduino releases fix this bug.

Another problem that I experienced while running my Arduino application is that the execution stopped at some point for no reason. After a while I realized that doing many Serial.println(..) was causing it, so I removed some and everything was working again. I suppose having a lot of debugging information going through the serial port could be interfering with the rest of operations.

Tips when using Arduino Libraries:

  • Better do not use the String Library, implement dynamic char arrays instead.
  • Limited Use of Serial.println(..).

And one last tip for debugging your Arduino Application: measure how much memory is free with the following code Free Memory!.

Post to Twitter


Like Box Project: Wrapping up!

Posted: December 19th, 2011 | Author: | Filed under: Arduino, Wordpress | No Comments »

There is no other better way than explaining the work through pictures! After finishing up the Like Box Project I want to show you the units from prototype to final version. In the next few days I will focus more on software and I will give some tips about programming with Arduino.
BTW, in this post I am using the “Awesome Flickr Gallery” plugin for WordPress, for now it works perfectly! It allows me to add a flickr set to any post even including description and title for each of the pictures.

Post to Twitter


Boards are ready to be boxed!

Posted: September 28th, 2011 | Author: | Filed under: Arduino | No Comments »

Finally, we have got our boards ready to be boxed!. Javi is working now on getting a customized clear plastic box for each unit. It’s gonna look fantastic!

Each unit consists of one Arduino Ethernet board, one Arduino Prototype Shield and two led displays of 8×32 pixels each. Since the units are connected to internet (we use a 3G modem router) the usage possibilities are enormous. In the picture we are showing on the displays the facebook like count of different webpages.

In order to get definitive connections we decided to get an Arduino Prototype Shield on top of each Arduino Ethernet, they are very useful and made our life much easier. In the next picture you can see definitive connections on the left and temporal connections on the right.

Temporal connections: for connecting the led displays to the Arduino we just use a breadboard (white plastic rectangle). Breadboards are useful during the testing stage when you still don´t know what are the final connections.

Definitive connections: once you know your connections you just need to solder the cables to the Arduino Prototype Shield (see left board). In our example we have soldered a flat 16-pin male connector to the Arduino Prototype Shield since this is the type of cable interfacing with the led displays.

It is piece of cake! any questions just leave a comment.

 

Post to Twitter


my first experiment with Arduino

Posted: July 14th, 2011 | Author: | Filed under: Arduino | No Comments »

I am entering Arduino’s world and… so far so good. The library for interfacing the led’s displays was available here, I would like to thank Gaurav Manek, his library it’s very powerful and well written, it saved me few days of work.

And now it’s about time for doing some more fancy stuff! keep you posted!

 

Post to Twitter