is Arduino library suitable for production environment? - Page 1
Forum section: electronics / general

author: Porama6400
author_rank: Regular Contributor
timestamp: May 06, 2018, 03:19:41 pm
content: I've heard that Arduino library pretty slow, but is it true?I personally only have seen a lot of delay in digitalWrite() but is it worth it to write everything from the ground up in Atmel Studio?

author: alexanderbrevig
author_rank: Frequent Contributor
timestamp: May 06, 2018, 03:25:06 pm
content: It simply depends on what you want to do.The library is plenty fast for most tasks. If it's not, then don't use itPersonally I'd never use arduino in a product.

author: Porama6400
author_rank: Regular Contributor
timestamp: May 06, 2018, 03:34:14 pm
content: I wonder, is anyone use Arduino library in production environment?

author: Mr. Scram
author_rank: Super Contributor
timestamp: May 06, 2018, 03:46:48 pm
content: You can use anything in a production environment, as long as you have properly verified and validated the suitability and stability of the product. Of course, simpler products hide bugs less easily.

author: dmills
author_rank: Super Contributor
timestamp: May 06, 2018, 04:07:42 pm
content: There are two approaches to design of any system, one is to make it so simple there are obviously no bugs, and the other is to make it so complex there are no obvious bugs....The issue with some of the Arduino libs is both efficiency and correctness, but if they are fast enough for your application and you have dug into them to make sure they don't smell too bad then why not? End of the day they are just a set of static libs, nothing very interesting.Now, that said, the environment has a culture of using libraries to do the trivial, and some of those libraries are not exactly the best thing I have ever seen written, so some care is advised (This actually goes for all libraries, the Arduino ones are nothing special).I would say that by the time you have the skills to validate the libraries, you will often not need them anymore.Regards, Dan.

author: b_force
author_rank: Super Contributor
timestamp: May 06, 2018, 04:14:29 pm
content: Quote from: Porama6400 on May 06, 2018, 03:34:14 pmI have seen MANY companies using Arduinos in production.Obviously not the standard Arduino board, but just an own designed PCB with the same (or similar) chip.Why wouldn't you? It's easy to program, information is readily available and for most designs you don't need super high speeds.

author: Mr. Scram
author_rank: Super Contributor
timestamp: May 06, 2018, 04:33:57 pm
content: Quote from: b_force on May 06, 2018, 04:14:29 pmI don't think it's about AVR, but it's about software instead.

author: b_force
author_rank: Super Contributor
timestamp: May 06, 2018, 04:37:55 pm
content: Quote from: Mr. Scram on May 06, 2018, 04:33:57 pmYes, that's what I was talking about as well?

author: Mr. Scram
author_rank: Super Contributor
timestamp: May 06, 2018, 04:43:01 pm
content: Quote from: b_force on May 06, 2018, 04:37:55 pmI misunderstood, I thought you were just talking about custom AVR boards.

author: westfw
author_rank: Super Contributor
timestamp: May 06, 2018, 08:51:07 pm
content: QuoteVery many 3D printers, for example. For some definition of "production environment."It's not like you can't say "in this part of the code, speed is unimportant and I will use digitalWrite() for maximum portability, but THIS part needs to be really fast, so it's NOT using the Arduino library functions at all (and isn't very portable.)"The decision process gets "clearer" when the library code you might use gets more complicated. "Everyone" is wiling to re-write digitalWrite(), but fewer people are willing to re-write the Wiznet library just for a "little bit of network connectivity", and very few people indeed want to write their own tcp/ip stack...

author: chris_leyson
author_rank: Super Contributor
timestamp: May 06, 2018, 10:10:01 pm
content: I've put an ATmega into a product and haven't had any issues with the Arduino libraries. I would avoid using the string class if you are doing a lot of string manipulationhttps://hackingmajenkoblog.wordpress.com/2016/02/04/the-evils-of-arduino-strings/. I haven't started using Atmel Studio yet so I can't comment on that but if you want to write stuff from the ground up it might be the best option.I initially started out developing the product around a PIC24 but it was slow going writing stuff from the ground up. Switching to the Arduino IDE and AVR chips got things done a lot faster.