Wednesday, June 10, 2015

Too bad! Norway abandoning FM Radio transmission as 2017





Bad news for the FM radio lovers. Indeed, FM radio transmission is being progressively dismissed in favor of digital radio. This should sound like a progress but I feel it like a loss!

Indeed, if FM radio transmission and reception needs a pretty limited amount of electronic components. This "easy access" played a fundamental role in the past (think of the famous "Radio Londres" service of BBC during the II world war and to the multitude of homemade receivers). Digital radio receivers won't have the same accessibility degree since they need more sophisticated electronics.

According to BBC (see here) Norway will be the first country to stop FM transmissions. Hope the others will follow as later as possible!

Hey, dear deciders!
I just achieved my FM radio library for Arduino, please let us enjoy it!!!

:-)

Sunday, June 7, 2015

How to distinguish Arduino's models at compile time?




This is a question that you probably already asked yourself when trying to write code that must work with different Arduino's variants. Indeed, when using I2C, timers or PWM, the pins concerned on the Arduino Uno for these operations are different from Arduino Mega or form Due, etc. Hence, how to avoid the multiplication of the source files, of the classes or to excessively overload functions?

Solution: use conditional compilation!

In this short note we try to explain how to do that. Indeed, digging into the avr include files (see io.h for example) one can find the following constants are used:

__AVR_ATmega328P__
__AVR_ATmega328__

These are used to recognize that we are compiling for Arduino Uno. For the Arduino Mega we find:

__AVR_ATmega1280__
__AVR_ATmega2560__

Therefore your code might look like:
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328P__)
  
  [your arduino uno code here]
  
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)

  [your arduino mega code here]


Enjoy!

Saturday, June 6, 2015

Sonar robot (multiple HC-SR04): Gastaud's version




Here is one more version of the sonar robot we have seen here. I would like to stress how fluid is the navigation of the robot. Give a look at the short movie to get convinced!

Photos

Bottom view.
Front view.
Top view.


The movie

Look at the robot moving in an homemade arena. It seems human operated but it is not! Just try yourself if you don't trust me.




The sketch

Look at here for the libraries. The main program is not yet greatly optimized (not the main goal at present) but it works smoothly.

Enjoy!