Author Topic: is Arduino library suitable for production environment?  (Read 3022 times)

0 Members and 1 Guest are viewing this topic.

Offline Porama6400Topic starter

  • Regular Contributor
  • *
  • Posts: 70
  • Country: th
is Arduino library suitable for production environment?
« on: May 06, 2018, 03:19:41 pm »
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?
« Last Edit: May 06, 2018, 03:36:19 pm by Porama6400 »
 

Offline alexanderbrevig

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: no
  • Musician, developer and EE hobbyist
    • alexanderbrevig.com
Re: is Arduino library actually slower?
« Reply #1 on: May 06, 2018, 03:25:06 pm »
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 it :)

Personally I'd never use arduino in a product.
 

Offline Porama6400Topic starter

  • Regular Contributor
  • *
  • Posts: 70
  • Country: th
Re: is Arduino library actually slower?
« Reply #2 on: May 06, 2018, 03:34:14 pm »
I wonder, is anyone use Arduino library in production environment?
 

Offline Mr. Scram

  • Super Contributor
  • ***
  • Posts: 9810
  • Country: 00
  • Display aficionado
Re: is Arduino library suitable for production environment?
« Reply #3 on: May 06, 2018, 03:46:48 pm »
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.
 

Offline dmills

  • Super Contributor
  • ***
  • Posts: 2093
  • Country: gb
Re: is Arduino library suitable for production environment?
« Reply #4 on: May 06, 2018, 04:07:42 pm »
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.
 

Offline b_force

  • Super Contributor
  • ***
  • Posts: 1381
  • Country: 00
    • One World Concepts
Re: is Arduino library actually slower?
« Reply #5 on: May 06, 2018, 04:14:29 pm »
I wonder, is anyone use Arduino library in production environment?
I 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. 

Offline Mr. Scram

  • Super Contributor
  • ***
  • Posts: 9810
  • Country: 00
  • Display aficionado
Re: is Arduino library actually slower?
« Reply #6 on: May 06, 2018, 04:33:57 pm »
I 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.
I don't think it's about AVR, but it's about software instead.
 

Offline b_force

  • Super Contributor
  • ***
  • Posts: 1381
  • Country: 00
    • One World Concepts
Re: is Arduino library actually slower?
« Reply #7 on: May 06, 2018, 04:37:55 pm »
I 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.
I don't think it's about AVR, but it's about software instead.
Yes, that's what I was talking about as well?

Offline Mr. Scram

  • Super Contributor
  • ***
  • Posts: 9810
  • Country: 00
  • Display aficionado
Re: is Arduino library actually slower?
« Reply #8 on: May 06, 2018, 04:43:01 pm »
Yes, that's what I was talking about as well?
I misunderstood, I thought you were just talking about custom AVR boards.
 
The following users thanked this post: b_force

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: is Arduino library suitable for production environment?
« Reply #9 on: May 06, 2018, 08:51:07 pm »
 
Quote
I wonder, is anyone use Arduino library in production environment?
Very 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...

 
 

Offline chris_leyson

  • Super Contributor
  • ***
  • Posts: 1541
  • Country: wales
Re: is Arduino library suitable for production environment?
« Reply #10 on: May 06, 2018, 10:10:01 pm »
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 manipulation https://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.
« Last Edit: May 06, 2018, 10:27:19 pm by chris_leyson »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf