Monday

Arduino coding

The largest difference between coding on an Arduino and coding on a computer is the lack of processing power present on an Arduino. Thus, I have been looking through the use of bitshifts and other such low-processing power commands. I have been looking at coding for the ears on the previously mentioned Guy Manuel helmet, since this is fairly simple to code for it is a good opportunity to try out syntax that I don't normally use. For example, before I used a digital "light source" and an array of points (nodes) to calculate the amount of theoretical light that the nodesd would receive, so that I could simulate a single mobile light source moving throughout a one dimensional string of LEDs. (I apologize if that sentence is a bit unclear, but the encompassing idea behind it is that the algorithm I used was overly complex.) This was extremely inefficient. Thus, I instead used a byte and bitshifts to function as a simple one-dimensional array. This is very easy on a processor to do, the only problem was reading in the byte as a bunch of bits, which is strangely difficult with the limited library that is given on the Arduino website. Thus, I need to teach myself proper C++ and use that rather than the default Arduino language, which is merely a modified version of C.


Again I apologize if that came off a bit convoluted, I tend to ramble.

No comments:

Post a Comment