<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>Comments on: Arduino programming</title>
	<atom:link href="http://www.epanorama.net/blog/2010/06/02/arduino-programming/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.epanorama.net/blog/2010/06/02/arduino-programming/</link>
	<description>All about electronics and circuit design</description>
	<lastBuildDate>Thu, 23 Apr 2026 07:21:42 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.14</generator>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2010/06/02/arduino-programming/comment-page-1/#comment-1860960</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Thu, 28 Aug 2025 07:33:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/blog/?p=2046#comment-1860960</guid>
		<description><![CDATA[Pascal? On My Arduino? It’s More Likely Than You Think
https://hackaday.com/2025/08/27/pascal-on-my-arduino-its-more-likely-than-you-think/

The Arduino ecosystem is an amazing learning tool, but even those of us who love it admit that even the simplified C Arduino uses isn’t the ideal teaching language. Those of us who remember learning Pascal as our first “real” programming language in schools (first aside from BASIC, at least) might look fondly on the AVRPascal project by [Andrzej Karwowski].

[Andrzej] is using FreePascal’s compiler tools, and AVRdude to pipe compiled code onto the micro-controller. Those tools are built into his AVRPascal code editor to create a Pascal-based alternative to the Arduino IDE for programming AVR-based microcontrollers. The latest version, 3.3, even includes a serial port monitor compatible with the Arduino boards.

AVRPascal 3.3 with UnoLib 1.1
https://akarwowski.pl/index.php?page=electronics&amp;lang=en

 AVRPascal is a Pascal code editor designed for programming AVR microcontrollers (ATtiny and ATmega families). It leverages the Free Pascal compiler to compile source code, and AVRdude to transfer the compiled code to the microcontroller&#039;s memory using programmers like USBasp or Arduino. Key features:

    Syntax highlighting for improved code readability.
    Error indication: Points to the line of code containing compilation errors.
    Tooltips: Provide information about function and procedure parameters, record fields, and class methods.
    Tabbed document interface for efficient code organization.
    Microcontroller fuse-bit configuration capability.
    Automatic detection of supported USB devices.
    Source code formatter.
    Serial port monitor for Arduino boards

 UnoLib is a Pascal library designed for the Arduino Uno platform (ATmega328p microcontroller). It is a translation of a subset of the standard Arduino libraries, adapted as needed for a Free Pascal environment. Moreover, support for fixed and floating point numbers has been added. Modules included:

    analog.pas - support for analog pins
    defs.pas - definitions of constatnts, bit manipulations, port support
    dht.pas - support for DHT11/22 sensors
    digital.pas - support for digital pins
    ds1302rtc.pas - support for ds1302 real time clock
    fix16.pas - support for fixed point numbers
    float32.pas - support for floating point numbers (in collaboration with @Dzandaa)
    hardwareserial.pas - support for serial communication
    i2c.pas - support for I2C communication bus (by @Dzandaa, many thanks to @ccrause)
    liquidcrystal.pas - support for LCD
    pulse.pas - routines for reading a pulse on a pin
    stringutils.pas - string conversion routiones (by @Dzandaa)
    timer.pas - time-related routines
    tone.pas - square wave tone routines]]></description>
		<content:encoded><![CDATA[<p>Pascal? On My Arduino? It’s More Likely Than You Think<br />
<a href="https://hackaday.com/2025/08/27/pascal-on-my-arduino-its-more-likely-than-you-think/" rel="nofollow">https://hackaday.com/2025/08/27/pascal-on-my-arduino-its-more-likely-than-you-think/</a></p>
<p>The Arduino ecosystem is an amazing learning tool, but even those of us who love it admit that even the simplified C Arduino uses isn’t the ideal teaching language. Those of us who remember learning Pascal as our first “real” programming language in schools (first aside from BASIC, at least) might look fondly on the AVRPascal project by [Andrzej Karwowski].</p>
<p>[Andrzej] is using FreePascal’s compiler tools, and AVRdude to pipe compiled code onto the micro-controller. Those tools are built into his AVRPascal code editor to create a Pascal-based alternative to the Arduino IDE for programming AVR-based microcontrollers. The latest version, 3.3, even includes a serial port monitor compatible with the Arduino boards.</p>
<p>AVRPascal 3.3 with UnoLib 1.1<br />
<a href="https://akarwowski.pl/index.php?page=electronics&#038;lang=en" rel="nofollow">https://akarwowski.pl/index.php?page=electronics&#038;lang=en</a></p>
<p> AVRPascal is a Pascal code editor designed for programming AVR microcontrollers (ATtiny and ATmega families). It leverages the Free Pascal compiler to compile source code, and AVRdude to transfer the compiled code to the microcontroller&#8217;s memory using programmers like USBasp or Arduino. Key features:</p>
<p>    Syntax highlighting for improved code readability.<br />
    Error indication: Points to the line of code containing compilation errors.<br />
    Tooltips: Provide information about function and procedure parameters, record fields, and class methods.<br />
    Tabbed document interface for efficient code organization.<br />
    Microcontroller fuse-bit configuration capability.<br />
    Automatic detection of supported USB devices.<br />
    Source code formatter.<br />
    Serial port monitor for Arduino boards</p>
<p> UnoLib is a Pascal library designed for the Arduino Uno platform (ATmega328p microcontroller). It is a translation of a subset of the standard Arduino libraries, adapted as needed for a Free Pascal environment. Moreover, support for fixed and floating point numbers has been added. Modules included:</p>
<p>    analog.pas &#8211; support for analog pins<br />
    defs.pas &#8211; definitions of constatnts, bit manipulations, port support<br />
    dht.pas &#8211; support for DHT11/22 sensors<br />
    digital.pas &#8211; support for digital pins<br />
    ds1302rtc.pas &#8211; support for ds1302 real time clock<br />
    fix16.pas &#8211; support for fixed point numbers<br />
    float32.pas &#8211; support for floating point numbers (in collaboration with @Dzandaa)<br />
    hardwareserial.pas &#8211; support for serial communication<br />
    i2c.pas &#8211; support for I2C communication bus (by @Dzandaa, many thanks to @ccrause)<br />
    liquidcrystal.pas &#8211; support for LCD<br />
    pulse.pas &#8211; routines for reading a pulse on a pin<br />
    stringutils.pas &#8211; string conversion routiones (by @Dzandaa)<br />
    timer.pas &#8211; time-related routines<br />
    tone.pas &#8211; square wave tone routines</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2010/06/02/arduino-programming/comment-page-1/#comment-1786155</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Fri, 11 Nov 2022 21:15:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/blog/?p=2046#comment-1786155</guid>
		<description><![CDATA[MicroPython officially becomes part of the Arduino ecosystem
https://blog.arduino.cc/2022/11/10/micropython-officially-becomes-part-of-the-arduino-ecosystem/]]></description>
		<content:encoded><![CDATA[<p>MicroPython officially becomes part of the Arduino ecosystem<br />
<a href="https://blog.arduino.cc/2022/11/10/micropython-officially-becomes-part-of-the-arduino-ecosystem/" rel="nofollow">https://blog.arduino.cc/2022/11/10/micropython-officially-becomes-part-of-the-arduino-ecosystem/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2010/06/02/arduino-programming/comment-page-1/#comment-1558292</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Wed, 09 Aug 2017 14:07:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/blog/?p=2046#comment-1558292</guid>
		<description><![CDATA[Check also
http://www.epanorama.net/newepa/2013/11/11/visual-programming-for-arduino/]]></description>
		<content:encoded><![CDATA[<p>Check also<br />
<a href="http://www.epanorama.net/newepa/2013/11/11/visual-programming-for-arduino/" rel="nofollow">http://www.epanorama.net/newepa/2013/11/11/visual-programming-for-arduino/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2010/06/02/arduino-programming/comment-page-1/#comment-1546683</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Fri, 12 May 2017 12:15:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/blog/?p=2046#comment-1546683</guid>
		<description><![CDATA[Building an Arduino sketch from scratch
http://thinkingonthinking.com/an-arduino-sketch-from-scratch/

Unix programmers have been building software for many years with the command line and the GCC toolchain. When developing for embedded systems, where clock cycles and memory usage counts, some familiarity with GCC is often needed.

The GCC tools come in different forms. For example, there is a variant for Atmel AVR microcontrollers which is an important part of the Arduino IDE. Also, you’ll find GCC versions for ARM which e.g. the Teensy 3 requires.

The Arduino IDE will install all the the AVR GCC tools for you.

Learning the secrets of compilers and build tools takes some practice. 

Imagine this blink.ino Arduino sketch

To compile this sketch with g++, you must include the Arduino.h header and include a main() function.

With the arduino.h header, you get functions to work with pins and ports. Also, you get function prototypes for the main parts of your sketch

void setup(void);
void loop(void);

Now, blink.cpp is valid for compilation.

As we used the pinMode and digitalWrite functions of Arduino core libraries, we need to package some of these libraries into our blink.o binary. 

Repeating these steps manually for every project would quickly become furstrating. To automate builds and configurations, there are Makefiles.

https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/Arduino.h]]></description>
		<content:encoded><![CDATA[<p>Building an Arduino sketch from scratch<br />
<a href="http://thinkingonthinking.com/an-arduino-sketch-from-scratch/" rel="nofollow">http://thinkingonthinking.com/an-arduino-sketch-from-scratch/</a></p>
<p>Unix programmers have been building software for many years with the command line and the GCC toolchain. When developing for embedded systems, where clock cycles and memory usage counts, some familiarity with GCC is often needed.</p>
<p>The GCC tools come in different forms. For example, there is a variant for Atmel AVR microcontrollers which is an important part of the Arduino IDE. Also, you’ll find GCC versions for ARM which e.g. the Teensy 3 requires.</p>
<p>The Arduino IDE will install all the the AVR GCC tools for you.</p>
<p>Learning the secrets of compilers and build tools takes some practice. </p>
<p>Imagine this blink.ino Arduino sketch</p>
<p>To compile this sketch with g++, you must include the Arduino.h header and include a main() function.</p>
<p>With the arduino.h header, you get functions to work with pins and ports. Also, you get function prototypes for the main parts of your sketch</p>
<p>void setup(void);<br />
void loop(void);</p>
<p>Now, blink.cpp is valid for compilation.</p>
<p>As we used the pinMode and digitalWrite functions of Arduino core libraries, we need to package some of these libraries into our blink.o binary. </p>
<p>Repeating these steps manually for every project would quickly become furstrating. To automate builds and configurations, there are Makefiles.</p>
<p><a href="https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/Arduino.h" rel="nofollow">https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/Arduino.h</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2010/06/02/arduino-programming/comment-page-1/#comment-1546679</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Fri, 12 May 2017 12:00:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/blog/?p=2046#comment-1546679</guid>
		<description><![CDATA[Pin I/O performance
In AVR, Hardware, Software on Jan 6, 2010 at 00:01
http://jeelabs.org/2010/01/06/pin-io-performance/]]></description>
		<content:encoded><![CDATA[<p>Pin I/O performance<br />
In AVR, Hardware, Software on Jan 6, 2010 at 00:01<br />
<a href="http://jeelabs.org/2010/01/06/pin-io-performance/" rel="nofollow">http://jeelabs.org/2010/01/06/pin-io-performance/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2010/06/02/arduino-programming/comment-page-1/#comment-1546678</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Fri, 12 May 2017 12:00:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/blog/?p=2046#comment-1546678</guid>
		<description><![CDATA[Arduino I/O Speed Breakdown
https://hackaday.com/2010/01/06/arduino-io-speed-breakdown/

[Jee Labs] has worked out how long it takes for an Arduino to perform various I/O operations. Predictably, analogRead() takes the longest, followed by analogWrite(). Arduino really falls behind when it comes to digital pin I/O: digitalWrite() takes a whopping fifty times longer than a direct bit write to a port register!  This is something to take into consideration when you are looking to do some beefy I/O with an Arduino.]]></description>
		<content:encoded><![CDATA[<p>Arduino I/O Speed Breakdown<br />
<a href="https://hackaday.com/2010/01/06/arduino-io-speed-breakdown/" rel="nofollow">https://hackaday.com/2010/01/06/arduino-io-speed-breakdown/</a></p>
<p>[Jee Labs] has worked out how long it takes for an Arduino to perform various I/O operations. Predictably, analogRead() takes the longest, followed by analogWrite(). Arduino really falls behind when it comes to digital pin I/O: digitalWrite() takes a whopping fifty times longer than a direct bit write to a port register!  This is something to take into consideration when you are looking to do some beefy I/O with an Arduino.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2010/06/02/arduino-programming/comment-page-1/#comment-1546659</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Fri, 12 May 2017 11:24:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/blog/?p=2046#comment-1546659</guid>
		<description><![CDATA[Templates Speed Up Arduino I/O
http://hackaday.com/2017/05/11/templates-speed-up-arduino-io/

It is easy to forget, but the Arduino does use C++. Typically, the C++ part is in the libraries and the framework and most people just tend to code their main programs using a C-style just using the library objects like C-language extensions. [Fredllll] recently created a template library to speed up Arduino I/O and he shared it on GitHub.

If you’ve ever done anything serious with the Arduino, you probably know that while digitalWrite is handy, it does a lot of work behind the scenes to make sure the pin is setup and this adds overhead to every call. [Fredllll’s] template versions can switch a pin’s state in two cycles. You can cut that in half if you don’t mind bothering the state of other pins on the same port.

https://github.com/fredlllll/FredUtil-Arduino/blob/master/fredOptimization.h]]></description>
		<content:encoded><![CDATA[<p>Templates Speed Up Arduino I/O<br />
<a href="http://hackaday.com/2017/05/11/templates-speed-up-arduino-io/" rel="nofollow">http://hackaday.com/2017/05/11/templates-speed-up-arduino-io/</a></p>
<p>It is easy to forget, but the Arduino does use C++. Typically, the C++ part is in the libraries and the framework and most people just tend to code their main programs using a C-style just using the library objects like C-language extensions. [Fredllll] recently created a template library to speed up Arduino I/O and he shared it on GitHub.</p>
<p>If you’ve ever done anything serious with the Arduino, you probably know that while digitalWrite is handy, it does a lot of work behind the scenes to make sure the pin is setup and this adds overhead to every call. [Fredllll’s] template versions can switch a pin’s state in two cycles. You can cut that in half if you don’t mind bothering the state of other pins on the same port.</p>
<p><a href="https://github.com/fredlllll/FredUtil-Arduino/blob/master/fredOptimization.h" rel="nofollow">https://github.com/fredlllll/FredUtil-Arduino/blob/master/fredOptimization.h</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2010/06/02/arduino-programming/comment-page-1/#comment-1546324</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Wed, 10 May 2017 09:28:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/blog/?p=2046#comment-1546324</guid>
		<description><![CDATA[Building an OBD Speed Pulse: Behold the ICE
http://hackaday.com/2017/05/09/obd-speed-pulse-part-2-behold-the-ice/

I am a crappy software coder when it comes down to it. I didn’t pay attention when everything went object oriented and my roots were always assembly language and Real Time Operating Systems (RTOS) anyways.

So it only natural that I would reach for a true In-Circuit-Emulator (ICE) to finish of my little OBDII bus to speed pulse generator widget. ICE is a hardware device used to debug embedded systems. It communicates with the microcontroller on your board, allowing you to view what is going on by pausing execution and inspecting or changing values in the hardware registers. If you want to be great at embedded development you need to be great at using in-circuit emulation.

Not only do I get to watch my mistakes in near real time, I get to make a video about it.

Walk through the process of using an In-Circuit Emulator in the video

I have the In-Circuit-Serial-Programming (ICSP) pins routed to a pin header on my board so that I can program the part directly.

On this connector you’ll find the Reset line, which means with this header I can use a true ICE utilizing the debugWIRE protocol. Since the vast majority of designs that use an AVR chip do not repurpose the reset pin for GPIO, it is a perfect pin to use for ICE. All of the communications during the debug process will take place on the reset pin.

As a hardware engineer by trade I would always reach for an ICE to kick off the implementation; only after the Beta release would the ICE start to gather dust in the corner.

In the case of the ATmega, the debugging capabilities are built into the microcontroller itself. This is a much more straightforward implementation than the early days when we had to have a second isolated processor running off-board with its own local RAM/ROM.

One note mentioned in the video is that a standard Arduino’ish board needs to have the filter capacitors removed from the RESET line to allow the high speed data on the line for its debugWIRE usage.

ICEyness

The ICE allows us to download and single step our code while being able to observe and overwrite RAM and I/O Registers from the keyboard.]]></description>
		<content:encoded><![CDATA[<p>Building an OBD Speed Pulse: Behold the ICE<br />
<a href="http://hackaday.com/2017/05/09/obd-speed-pulse-part-2-behold-the-ice/" rel="nofollow">http://hackaday.com/2017/05/09/obd-speed-pulse-part-2-behold-the-ice/</a></p>
<p>I am a crappy software coder when it comes down to it. I didn’t pay attention when everything went object oriented and my roots were always assembly language and Real Time Operating Systems (RTOS) anyways.</p>
<p>So it only natural that I would reach for a true In-Circuit-Emulator (ICE) to finish of my little OBDII bus to speed pulse generator widget. ICE is a hardware device used to debug embedded systems. It communicates with the microcontroller on your board, allowing you to view what is going on by pausing execution and inspecting or changing values in the hardware registers. If you want to be great at embedded development you need to be great at using in-circuit emulation.</p>
<p>Not only do I get to watch my mistakes in near real time, I get to make a video about it.</p>
<p>Walk through the process of using an In-Circuit Emulator in the video</p>
<p>I have the In-Circuit-Serial-Programming (ICSP) pins routed to a pin header on my board so that I can program the part directly.</p>
<p>On this connector you’ll find the Reset line, which means with this header I can use a true ICE utilizing the debugWIRE protocol. Since the vast majority of designs that use an AVR chip do not repurpose the reset pin for GPIO, it is a perfect pin to use for ICE. All of the communications during the debug process will take place on the reset pin.</p>
<p>As a hardware engineer by trade I would always reach for an ICE to kick off the implementation; only after the Beta release would the ICE start to gather dust in the corner.</p>
<p>In the case of the ATmega, the debugging capabilities are built into the microcontroller itself. This is a much more straightforward implementation than the early days when we had to have a second isolated processor running off-board with its own local RAM/ROM.</p>
<p>One note mentioned in the video is that a standard Arduino’ish board needs to have the filter capacitors removed from the RESET line to allow the high speed data on the line for its debugWIRE usage.</p>
<p>ICEyness</p>
<p>The ICE allows us to download and single step our code while being able to observe and overwrite RAM and I/O Registers from the keyboard.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2010/06/02/arduino-programming/comment-page-1/#comment-1545842</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Fri, 05 May 2017 14:52:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/blog/?p=2046#comment-1545842</guid>
		<description><![CDATA[Using Modern C++ Techniques with Arduino
http://hackaday.com/2017/05/05/using-modern-c-techniques-with-arduino/

C++ has been quickly modernizing itself over the last few years. Starting with the introduction of C++11, the language has made a huge step forward and things have changed under the hood. To the average Arduino user, some of this is irrelevant, maybe most of it, but the language still gives us some nice features that we can take advantage of as we program our microcontrollers.

Modern C++ allows us to write cleaner, more concise code, and make the code we write more reusable. The following are some techniques using new features of C++ that don’t add memory overhead, reduce speed, or increase size because they’re all handled by the compiler. Using these features of the language you no longer have to worry about specifying a 16-bit variable, calling the wrong function with NULL, or peppering your constructors with initializations. The old ways are still available and you can still use them, but at the very least, after reading this you’ll be more aware of the newer features as we start to see them roll out in Arduino code.

C++11 introduced a series of fixed width integer types aliases that will give you the number of bits (in multiples of 8) you want. There are both signed and unsigned versions. If you use int16_t for a variable you know it’s 16 bits, regardless of which Arduino is being targeted.

The concept of an anonymous namespace has been around for a while in C++, but it came to prominence with the introduction of C++11. In C++11, the anonymous namespace is now the preferred way to specify a variable, function, or class that is accessible only in the current file

Anonymous namespaces take the place of declaring things static. Anything you may have declared as static or const, or written as a #define can now put into an anonymous namespace and have the same effect – anything defined in inside cannot be accessed outside of the ‘.cpp’ file that the namespace is in. In the Arduino IDE, though, if you add a tab and give the new tab a name that doesn’t end in ‘.cpp’ or ‘.h’ then the file is given an extension of ‘.ino.’ When you click the ‘Verify’ button, all the ‘.ino’ files are concatenated into a single ‘.cpp’ file.]]></description>
		<content:encoded><![CDATA[<p>Using Modern C++ Techniques with Arduino<br />
<a href="http://hackaday.com/2017/05/05/using-modern-c-techniques-with-arduino/" rel="nofollow">http://hackaday.com/2017/05/05/using-modern-c-techniques-with-arduino/</a></p>
<p>C++ has been quickly modernizing itself over the last few years. Starting with the introduction of C++11, the language has made a huge step forward and things have changed under the hood. To the average Arduino user, some of this is irrelevant, maybe most of it, but the language still gives us some nice features that we can take advantage of as we program our microcontrollers.</p>
<p>Modern C++ allows us to write cleaner, more concise code, and make the code we write more reusable. The following are some techniques using new features of C++ that don’t add memory overhead, reduce speed, or increase size because they’re all handled by the compiler. Using these features of the language you no longer have to worry about specifying a 16-bit variable, calling the wrong function with NULL, or peppering your constructors with initializations. The old ways are still available and you can still use them, but at the very least, after reading this you’ll be more aware of the newer features as we start to see them roll out in Arduino code.</p>
<p>C++11 introduced a series of fixed width integer types aliases that will give you the number of bits (in multiples of 8) you want. There are both signed and unsigned versions. If you use int16_t for a variable you know it’s 16 bits, regardless of which Arduino is being targeted.</p>
<p>The concept of an anonymous namespace has been around for a while in C++, but it came to prominence with the introduction of C++11. In C++11, the anonymous namespace is now the preferred way to specify a variable, function, or class that is accessible only in the current file</p>
<p>Anonymous namespaces take the place of declaring things static. Anything you may have declared as static or const, or written as a #define can now put into an anonymous namespace and have the same effect – anything defined in inside cannot be accessed outside of the ‘.cpp’ file that the namespace is in. In the Arduino IDE, though, if you add a tab and give the new tab a name that doesn’t end in ‘.cpp’ or ‘.h’ then the file is given an extension of ‘.ino.’ When you click the ‘Verify’ button, all the ‘.ino’ files are concatenated into a single ‘.cpp’ file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2010/06/02/arduino-programming/comment-page-1/#comment-1491763</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Thu, 26 May 2016 04:05:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/blog/?p=2046#comment-1491763</guid>
		<description><![CDATA[Learn Functional Reactive Programming on Your Arduino
http://hackaday.com/2016/05/25/learn-functional-reactive-programming-on-your-arduino/

Juniper is a functional reactive programming language for the Arduino platform. What that means is that you’ll be writing your code using anonymous functions, map/fold operations, recursion, and signals. It’s like taking the event-driven style that you should be programming in one step further; you write a=b+3 and when b changes, the compiler takes care of changing a automatically for you. (That’s the “reactive” part.)

If you’re used to the first-do-this-then-do-that style of Arduino (and most C/C++) programming, this is going to be mind expanding. But we do notice that a lot of microcontroller code looks for changes in the environment, and then acts (more or less asynchronously) on that data.

http://www.juniper-lang.org/tutorial.html]]></description>
		<content:encoded><![CDATA[<p>Learn Functional Reactive Programming on Your Arduino<br />
<a href="http://hackaday.com/2016/05/25/learn-functional-reactive-programming-on-your-arduino/" rel="nofollow">http://hackaday.com/2016/05/25/learn-functional-reactive-programming-on-your-arduino/</a></p>
<p>Juniper is a functional reactive programming language for the Arduino platform. What that means is that you’ll be writing your code using anonymous functions, map/fold operations, recursion, and signals. It’s like taking the event-driven style that you should be programming in one step further; you write a=b+3 and when b changes, the compiler takes care of changing a automatically for you. (That’s the “reactive” part.)</p>
<p>If you’re used to the first-do-this-then-do-that style of Arduino (and most C/C++) programming, this is going to be mind expanding. But we do notice that a lot of microcontroller code looks for changes in the environment, and then acts (more or less asynchronously) on that data.</p>
<p><a href="http://www.juniper-lang.org/tutorial.html" rel="nofollow">http://www.juniper-lang.org/tutorial.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
