Hi,
Should I use custom light libraries or Arduino official libraries? Would Arduino libraries use more overhead to my program size?
Thanks,
Hi,
Should I use custom light libraries or Arduino official libraries? Would Arduino libraries use more overhead to my program size?
Thanks,
Should I use custom light libraries or Arduino official libraries?
Use the official libraries, I don't like that calorie reduced stuff.
Would Arduino libraries use more overhead to my program size?
No jokes anymore: who told you such undifferentiated bullshit?
BTW, which Arduino library does have a custom light alternative library?
pylon:
Use the official libraries, I don't like that calorie reduced stuff.
Yes, official libraries are more reliable than other custom user libraries.
But to me, I have to work with internal coding, because that gives me more programming skills, and I learn something new every time.
Of course finally I need to do an application project.
And I did last two semesters, I did several small projects in college diploma graduation course with my own libraries. And it worked, but there were some problems happened with i2c communication because my i2c library was so basic and does not have bus control.
That's where I knew I have to focus more on the internal libraries or just use Arduino libraries.
No jokes anymore: who told you such undifferentiated bullshit?
BTW, which Arduino library does have a custom light alternative library?
I've tested that myself. When I use basic simple libraries, the compile size is reduced and when I use Arduino libraries the compile size increases.
That doesn't matter for small projects, in big projects I can use a bigger chip.
But for example, I can use internal twi library instead on Wire library, do you agree with me in this point?
I guess you can also take he approach that you would program everything in assembly language and be even more efficient?
There comes a point at which you need to have maintainable and portable code. For most users in Arduino-land this means using standard libraries as much as possible. You don't need to recode low level stuff because the Arduino team has done that for you.
If you enjoy doing your own libraries then go for it. I don't think that the efficiency argument holds much water here unless you are producing a professional product, in which case I would suggest that the Arduino ecosystem is not the most efficient for writing that sort of code.
IMHO
I've tested that myself. When I use basic simple libraries, the compile size is reduced and when I use Arduino libraries the compile size increases.
So you probably use only a subset of the functionality the official library supports. I guess if you need a car you don't buy basic car component and build your own vehicle just because you don't need a second rear mirror.
But for example, I can use internal twi library instead on Wire library, do you agree with me in this point?
No, I don't see any advantage to use the Arduino platform and then write custom alternatives for existing standard libraries. It will not be portable and the risk to fail is much higher. If you want to do everything the hard way, don't use the Arduino platform but use a bare GCC with the Atmel header files or code in assembler to have an even more painful live. The Arduino platform was built to provide an environment where projects can be realized quite fast and often successfully.
One reason to use TWI (or build a custom library on top of it) is that it supports the I2C Repeated Start technique while the WIRE library does not. So, if your I2C requires Repeated Start, then you can't use WIRE.
gfvalvo:
One reason to use TWI (or build a custom library on top of it) is that it supports the I2C Repeated Start technique while the WIRE library does not. So, if your I2C requires Repeated Start, then you can't use WIRE.
sendStop parameter in endTransaction and requestFrom?
Juraj:
sendStop parameter in endTransaction and requestFrom?
An I2C transaction with repeated Start(s) only includes one Stop - at the very end. No Stop signals are allowed in the middle of the transaction, which is what I think you are proposing?
marco_c:
I guess you can also take he approach that you would program everything in assembly language and be even more efficient?There comes a point at which you need to have maintainable and portable code. For most users in Arduino-land this means using standard libraries as much as possible. You don't need to recode low level stuff because the Arduino team has done that for you.
IMHO
Yep, you're absolutely right, I'm really mixing the stuff. I didn't really understand the big goal of Arduino platform, it's about C++ libraries and portable code.
If I want to do something, then I should develop a library for a sensor or anything using Arduino official libraries.
If you enjoy doing your own libraries then go for it. I don't think that the efficiency argument holds much water here unless you are producing a professional product, in which case I would suggest that the Arduino ecosystem is not the most efficient for writing that sort of code.
Thanks for this answer I totally forgot about other platforms and that the fact that there are different options out there if I want to do things on my own. Also most other platforms have its own libraries too.
I think I'm missing the point there adding more code which of course means more program size, is actually more reliable code, than something that is maybe small as much as possible and not reliable because there hasn't been enough lines to control the code.
I really need to realize the difference of working in Atmel environment than working in Arduino platform.
I've been doing things for sensors and modules, trying to program them with my own programming which is a good practice for programming. BUT, now I have to change all my strategy.
Arduino was my starting point in programming, but because I needed to program things by myself, I started to do libraries .. etc. But now I moved all these codes to Atmel workspace.
Arduino just need application codes for projects and that's all. Libraries are done by good programmers. If I like to do something to be posted and be used and reliable for other programmers, then I have to program a good code.
gfvalvo:
One reason to use TWI (or build a custom library on top of it) is that it supports the I2C Repeated Start technique while the WIRE library does not. So, if your I2C requires Repeated Start, then you can't use WIRE.
Yep, the twi is well written, I just copied that util library to my Atmel workspace. And then if I wanted to implement the repeated start in the Wire library, then I should edit the Wire library to include that feature.
It could be my first try to do something that could be meaningful to others
gfvalvo:
An I2C transaction with repeated Start(s) only includes one Stop - at the very end. No Stop signals are allowed in the middle of the transaction, which is what I think you are proposing?
the mentioned functions can be called with sendStop false
Juraj:
the mentioned functions can be called with sendStop false
Thanks, I'll check it out.