![]() ![]() And as a "part time" teacher I'm glad for that. This is getting off topic, but I did want to point out Arduino puts teach-ability over efficient code. I'd take that over him/her getting frustrated because he doesn't understand what the :: means and giving up a possible STEM career choice. So what if my student's dog door access system compiles to 6 lines instead of 2. As someone who has taught 3 years of summer camps and a few crash course classes for Middle School teachers, I really appreciate what Arduino has done. Not for hardcore developers to use on resource limited projects.īut to make it easier for High school students to pick up programming. Not to be the next new efficient toolchain. You can have your thread back now :).ĭeonb, I've heard this argument many times, and those that make it usually forget why Arduino was created. PS: Also sorry to madsci - this really has nothing to do with your original post. Can you tell I was a C++ compiler dev in a previous life. Sorry, I know nobody on this forum has anything to do with the decisions that went into Arduino, but it just bugs me when C++ gets underused. Don't use C with some classes and think you're doing people a favor. Since it's now left-to-right syntax, if you're in a modern IDE like AtmelStudio, you actually get syntax completion after typing LEDPin:: so you can explore the available operations on it:Īnyway, my point is, if you want to use C++, use C++ to it's full extent - it's a great language, especially C++ 11. No function call or other overhead.Īnd you still have as usable, or I would argue a slightly more usable syntax than the Arduino code above. Exactly the same 2 as you would have written in assembler. However, since the PIN is a class, the compiler knows more about what you're up to at compile time, so it can do a better job optimizing. Here's using a little simple template header I wrote for - you can imagine what it does:Īlso 3 lines, but it's slightly more object oriented. ![]() I can dump the implementation of those function calls, but you get the point. It's not object orientated by any means, and it produces traditional 'C' like output: I WISH they actually used real C++ object orientation - C++ is so much more powerful than C in terms of optimization.Ĭase and point, let's take a basic example in Arduino: If it was object oriented, a pin would be an object.Īrduino is basically namespace separation from someone who doesn't like the C++ syntax for a namespace, so they used classes instead to group functions. There's nothing special to an Arduino library other than a standardized way to use object oriented programming to make a consistent experience for the end user. I'm surprised the Arduino Wiznet driver can't handle that. I haven't had much experience with wiznet, but as I understand it sACN uses the UDP application layer and has some rules about IP address and broadcasting. It would just take extra effort to polish it off, and that may be duplicate effort. I'll be writing my own parsing code either way not for the communities benefit just my own. Then check with me to see how far I am on the sACN library suite. So if you're going to get started, start with Renard. And they include a lot of junk we don't need. The current wiznet libraries (arduino Ethernet library) don't actually do everything needed to properly support sACN. My intention was to write an sACN parsing library, and trimmed down wiznet driver libraries that only do the stuff needed for sACN. It should work on either arduino or atmel studio. I plan on making it not arduino specific. I already have the sACN library project on my todo list for this spring. So it would be easy to pull into AVR studio as well. Since this is just a parsing library, I'd intentionally keep it high level (remember I'm writing it so I can port it to another architecture). ![]() Depending on the purpose of the library there may be low level operations that would hard tie it to a specific target. Is it possible to create a shared library that's usable by both AVR natively, as well as Arduino? ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |