<div dir="ltr">Perhaps it is not clear: Arduino (and HAL) <i>is C/C++. </i>They are a set of libraries that sit between you and the low level definitions of registers (a "hardware abstraction"), but it's all written in C and knowing how to speak one you can learn to speak the other very fast.<div>For example,</div><div>To set an output pin in arduino you call</div><div><br></div><div>pinMode(PIN, OUTPUT);</div><div><br></div><div>This is a C function that inside it hides all the gritty details of setting the appropriate registers as they are described in the manual. for atmega328p you would write something like</div><div><br></div><div>DDRB|=0b00000001;</div><div><br></div><div>The ease comes from the fact that somewhere in the arduino libraries there are definitions, that tell the libraries how to handle different boards. If you plug in a teensy, which is STM32, PJRC has done this work and pinMode() will call whatever is appropriate for that processor. Instead of having to clearly tell the system which pin of which port you want to manipulate, it lets you refer to it with a simple mnemonic to lower the complexity.<br></div><div>HAL does the same thing, but uses its own lingo. It's still C and all the syntax rules, features and tricks apply. </div><div>So, basically, pick up an arduino and a breadboard, read up on how to interface it with 12V signals and start playing around. Sequencers, led VU meters, MIDI to CV, CV recording, random generators, sample and holds are only a few examples of what you can do with the humble nano and some extra peripherals.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 4, 2020 at 7:57 PM Shawn Rakestraw <<a href="mailto:shawnrakestraw@gmail.com">shawnrakestraw@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Spiros, if you were at about the same level with either C or Arduino, would you say one is better to fully learn before the other? Thanks for mentioning the STM32 libraries. I will remember that for the future.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 4, 2020 at 12:50 PM Spiros Makris <<a href="mailto:spirosmakris92@gmail.com" target="_blank">spirosmakris92@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div>STM32 has its own libraries (nicknamed "HAL" - hardware abstraction layer) which in many ways feels like an arduino; of course the names of the functions and the structure of the whole thing is different, but the goal is similar.<div>The controllers you're probably interested in all use C/C++ so as far as languages go, that's the most obvious (and reasonable) choice. C can be confusing but I think most of it should be within reach for anyone with a programming affinity.</div><div>Don't get into the library trap that many Arduino developers seem to fall. They are nice to kickstart a project and give you an idea of how things work but don't be fooled into thinking that you can postpone learning the "deeper" stuff forever. Hopefully, all the stuff you need will be out there, maintained and working well; that has rarely been the case for me, there's always something missing and you have to fill in the blanks.</div><div>Try not to think of embedded C like you would a high-level scripting language like python. You are not commanding obscure black boxes around and some manager just figures it out - you need to be conscious of what you are asking the system to do and very specific as to how it will be done. Abstraction, objects and other such features help you manage this complexity, but it will always be there to an extend. </div><div>Arduino (atmega328p basically) is perfectly capable of doing lots of stuff. It certainly can't do DSP, but that's only a small part of what digital modules do inside our synths. Unless you really are shooting for sound processing or generation chances are an Arduino nano will do just fine.</div><div><br></div><div>Spiros</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 3, 2020 at 4:49 AM Shawn Rakestraw <<a href="mailto:shawnrakestraw@gmail.com" target="_blank">shawnrakestraw@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Please don't go into extreme detail (unless you really want to). I ask too many simple questions and I feel bad that everyone spends great amounts of time with it.</div><div><br></div><div>I am thinking about programming ARM chips like the STM32 for something like Braids. I know that I will not be making my own Braids module anytime soon, but I would like to start thinking about the language I need to learn. I know the most about C++. I also realize that my question may be better asked as what libraries should I load / study up on.</div><div><br></div><div>Thanks guys/gals<br></div></div>
_______________________________________________<br>
Synth-diy mailing list<br>
<a href="mailto:Synth-diy@synth-diy.org" target="_blank">Synth-diy@synth-diy.org</a><br>
<a href="http://synth-diy.org/mailman/listinfo/synth-diy" rel="noreferrer" target="_blank">http://synth-diy.org/mailman/listinfo/synth-diy</a><br>
Selling or trading? Use <a href="mailto:marketplace@synth-diy.org" target="_blank">marketplace@synth-diy.org</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>