C++

Home/Tag:C++
20 02, 2011

A Menu System – Thoughts about data storage (ATMEGA328)

By | 2016-11-05T11:17:47+00:00 February 20th, 2011|Lightive Project|0 Comments

As i was designing the menu system it quickly became clear that all of the strings required for display would need quite a bit of program memory which simply was not available. Storing these in program memory as variables also meant they were loaded to the ATMEGA328's 2k of ram which will already be managing an array (no pun intended :p) of other variables. This was also a good time to begin considering where settings would be [...]

19 02, 2011

Issue – Driver freezing

By | 2015-01-13T23:46:13+00:00 February 19th, 2011|Lightive Project|0 Comments

The Issue When initially turned on the driver would happily receive commands and act on them. If the device transmitting the commands was interrupted then restarted it would cause the driver to freeze. The issue was reliably replicated. The Cause Using an array of serial messages to debug the code it was apparent the issue was the driver getting stuck in a loop governed by a "millis" function. The millis functions are part of the radio library for the Alpha modules [...]

17 02, 2011

Rounding Error Issues of Floating Arithmetic – Arduino

By | 2016-11-05T11:17:47+00:00 February 17th, 2011|Lightive Project|0 Comments

There is an issue with the previously shown fade mathematics which only appear on the Arduino. What seemed strange at first soon became clear. Micro-controllers are inherently more  comfortable performing integer mathematics over floating point. After analysing the results of the equations which were output to the computer via serial, the issue became clear. Rounding error of floating point arithmetic. The reason behind this rounding error is a cumulative error build up by recalculating repeatedly with an already error vulnerable result. [...]

17 02, 2011

Calculating the Fade Mathematics

By | 2015-01-13T23:40:23+00:00 February 17th, 2011|Lightive Project|0 Comments

A C++ program was written to aid the design of code to be used to calculate and then implement fades on the driver unit. The program reads in all of the values which would be sent over a standard radio packet. This is | BAR | RED Val| GREEN Val | BLUE Val | Fade Time | . It then collects some information which the system will already know, this is the current values of the selected [...]

3 01, 2011

A LIBRARY DEDICATED TO THE SYSTEM

By | 2015-01-13T23:40:53+00:00 January 3rd, 2011|Lightive Project|0 Comments

Introduction By this point much experience and understanding had been gained in the use of libraries and their ability to simplify what is going on in the main program. It was decided that a library will be written to support the lighting system as a whole. This will cut down on code repetition and allow for quicker implementation of new features and tweaks. Code written to date has been modified and transferred to the library. The Library [...]