Now that you know what Linux is, you might be thinking "Wow that's great, it would be really nice to run 'programs' on my Arduino instead of messing around with interrupts for when I want to drive Servos and NeoPixels at the same time".
Do you need to use Linux for your projects?
Maybe not, for a lot of things! A full modern operating system is overkill for many problems, and lots of simple, modular hardware tools are available these days. It’s easier than it ever has been to build a gadget using Arduino+sensors+display and teach it what you need it to do.
On the other hand, little computers that run Linux well can be had for less than $50, and Linux is an incredibly powerful platform.
When you DONT want to use Linux
OK this isn't a hard and fast list of rules, but more stuff to keep in mind when you are deciding whether to use a Linux-based computer or go with something embedded/"bare metal"
- Power requirements are way higher for 'computers' - a microcontroller can use under a milliWatt, its tough to get a linux computer under 1 Watt. You may also have cooling management to deal with if your linux board is running 'hot'
- Speed-to-boot: if you don't have a bootloader, a microcontroller will start running its 'program' in milliseconds or less. Linux computers tend to require at least a minute, although you can sometimes tweak this down or it can take much more
- Disk Corruption: barring cosmic rays, once a program is burned into the FLASH of an Arduino chip, it's there for life. You can turn it on 50 years from now and it'll be exactly the same. Linux computer disk drives can get corrupted by power fluctuations and can 'fail to boot' if data is not written correctly (there are ways to avoid this but its a bit of work and never completely foolproof)
- Size: Computers need a lot of stuff like FLASH, RAM, bus managers, multiple power supply regulators, they'll be bigger physically
- Price: All those parts cost $ too! You can DIY an Arduino for a few $, but its hard to get a linux computer for under $25. It's not much but if you need to make a lot of your project, it adds up!
- "Real Time" needs: If you are trying to perform a task with very specific timing requirements, like "precisely 0.5 milliseconds after this button is pressed, activate the flash bulb", a microcontroller will excel because it does not have to kernel running around from task to task. It will listen for the button, then wait for the exact amount of time. With linux, the kernel is doing all this stuff in the background, so many timing-specific stuff can be a challenge.
- Complexity: With so many interplaying parts, a lot more can go wrong...
When you WANT use Linux
A robust, modern OS makes it easy to speak network protocols (TCP/IP! SSL!), process large/complicated files like compressed photos/music/video, use low-cost off-the-shelf hardware that talks over USB, and grants access to countless different programming languages and other tools:
- A traditional Unix shell and the GNU core utilities
- Languages like: C/C++, Go, Python, Ruby, Perl, Scheme, PHP, and Java
- Frameworks like: Node.js (including libraries written especially for embedded development) and Flask
- Package managers and repositories like apt, npm, CPAN, pip, Packagist, and RubyGems, offering fast access to tens of thousands of open source applications and libraries
- A full TCP/IP network stack and toolset
- Easy and familiar file storage to disk drives and SD cards
- Mature databases like PostgreSQL, MySQL, and SQLite
- Web servers like nginx, Apache, and lighthttpd
Linux is a gateway to half a century’s worth of accumulated knowledge, and a bridge from your work to the wider world.
It’s also — and this is important — totally within your reach to learn. In the rest of this series, we’ll provide a gentle introduction to basic computing with Linux, touch on the history of its key ideas, and explore how those ideas can be applied in creative work.
Text editor powered by tinymce.