<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Microcontrollers on Bald Engineer</title><link>https://www.baldengineer.com/category/tutorials/microcontrollers</link><description>Recent content in Microcontrollers on Bald Engineer</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Thu, 31 Mar 2022 01:13:28 +0000</lastBuildDate><atom:link href="https://www.baldengineer.com/category/tutorials/microcontrollers/index.xml" rel="self" type="application/rss+xml"/><item><title>Standalone Arduino Turn-On and Debug</title><link>https://www.baldengineer.com/standalone-arduino-turn-on-and-debug.html</link><pubDate>Mon, 09 Jul 2018 13:00:54 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?post_type=video&amp;p=7489</guid><description>This AddOhms episode is part 3 of the “design your own Arduino” series. In this one I populate a bare PCB, reflow solder it, debug a few issues, and load the Uno bootloader. Originally, I designed 2 versions of the board. One version contained an error that I planned to fix in the episode. Well, turns out, the “correct” board had two issues which were more interesting.&#10;Check out the #27 show notes for links to a bunch of stuff in the episode, including the design files.<p><a href="https://www.youtube.com/watch?v=QYZY1anoUnA"><img src="https://i.ytimg.com/vi/QYZY1anoUnA/hqdefault.jpg" alt="Standalone Arduino Turn-On and Debug"/></a></p><p><iframe src="https://www.youtube-nocookie.com/embed/QYZY1anoUnA" title="Standalone Arduino Turn-On and Debug" width="560" height="315" loading="lazy" allowfullscreen="allowfullscreen"><a href="https://www.youtube.com/watch?v=QYZY1anoUnA">Watch this video on YouTube</a></iframe></p></description></item><item><title>Learn Six Oscilloscope Measurements with an Arduino DUT</title><link>https://www.baldengineer.com/six-oscilloscope-measurements-using-arduino.html</link><pubDate>Wed, 13 Jun 2018 18:44:22 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=7334</guid><description>One of the best ways to learn how to use a new piece of test equipment is to use it. Sounds easy, right? The problem is, sometimes when you are in the middle of troubleshooting your circuit, figuring out what the knobs on your scope do is an immense frustration. Use these 6 oscilloscope measurements, and just an Arduino Uno, to learn how to use a new or unfamiliar digital scope.<p><img src="https://www.baldengineer.com/wp-content/uploads/2018/06/Oscilloscope-Measurements-with-RTM3004-Alternative.jpg" alt="Learn Six Oscilloscope Measurements with an Arduino DUT"/></p></description></item><item><title>5 Common Arduino Programming Mistakes</title><link>https://www.baldengineer.com/5-common-arduino-programming-mistakes.html</link><pubDate>Wed, 17 Aug 2016 13:39:41 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=6145</guid><description>Whenever someone sends me some code that doesn’t work, there are a few common Arduino programming mistakes that I check. Some of these mistakes I make myself. In most cases my code will compile just fine. Sometimes, these mistakes won’t generate any compiler error.&#10;When my Arduino code is acting up, these are the first things I check. Here are my 5 common Arduino programming mistakes, I use to debug non-working code.<p><img src="https://www.baldengineer.com/wp-content/uploads/2016/08/5-common-arduino-programming-mistakes.jpg" alt="5 Common Arduino Programming Mistakes"/></p></description></item><item><title>Arduino Bootloader, What is it?</title><link>https://www.baldengineer.com/arduino-bootloader.html</link><pubDate>Wed, 15 Jun 2016 13:00:14 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=6066</guid><description>Almost all microcontroller (and microprocessor) development systems use some form of a bootloader. Often called firmware, mistakenly, the Arduino bootloader is one example. Since it is a rather popular platform, let’s use it as an example. Let’s talk about what a bootloader does and how it works.&#10;When a microcontroller turns on, it only knows how to do one thing. Typically, that one thing is to run an instruction found at a specific memory location. Often this location address 0x0000, but not always. Usually, this memory location will contain a jump instruction to another place in memory, which is the start of the user program. The bootloader, however, exists in a slightly separate memory space from the user program.<p><img src="https://www.baldengineer.com/wp-content/uploads/2016/06/arduino-bootloader-banner.jpg" alt="Arduino Bootloader, What is it?"/></p></description></item><item><title>Proper Larson Scanner with Software PWM (Repost)</title><link>https://www.baldengineer.com/proper-larson-scanner-with-sw-pwm.html</link><pubDate>Wed, 21 Oct 2015 16:00:03 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=5501</guid><description>Last week I had a detailed Arduino tutorial on software pulse width modulation using millis() and micros(). Why? Because I wanted to create a Proper Larson Scanner, with persistence and at least 8 LEDs.&#10;KITT larson scanner example&#10;Even though it is a popular project for the Arduino Uno, most Larson scanner tutorials, like my first one, have a few flaws. First, there is no persistence, or tail, to the LED as it moves back and forth. Persistence could be solved by using pulse-width-modulation. The Uno and other 328p-based micros only have 6 Pulse Width Modulation (PWM) pins. And let’s be honest, every project is made better by adding more LEDs. :)<p><img src="https://www.baldengineer.com/wp-content/uploads/2015/10/cylon-pumpkin-proper-larson-banner.jpg" alt="Proper Larson Scanner with Software PWM (Repost)"/></p></description></item><item><title>Space Invaders on Gecko EFM32</title><link>https://www.baldengineer.com/space-invaders-on-gecko-efm32.html</link><pubDate>Fri, 16 Jan 2015 15:05:08 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?post_type=video&amp;p=3178</guid><description>The Gecko Zero EFM32 Weather Station Evaluation Board from Silicon Labs is intended to show off the low-energy or energy harvesting capabilities of the EFM32 Zero. The ARM-based board has physical and cap sensitive buttons along with the LCD.&#10;It comes pre-loaded with a demo program, which is the classic Space Invaders.&#10;If you’re interested in more about the board, I wrote a road test of Gecko EFM32 on element 14. (Spoilers: I wasn’t impressed. Not a bad board, but rough development environment.)<p><a href="https://www.youtube.com/watch?v=wRb7gWNi540"><img src="https://i.ytimg.com/vi/wRb7gWNi540/hqdefault.jpg" alt="Space Invaders on Gecko EFM32"/></a></p><p><iframe src="https://www.youtube-nocookie.com/embed/wRb7gWNi540" title="Space Invaders on Gecko EFM32" width="560" height="315" loading="lazy" allowfullscreen="allowfullscreen"><a href="https://www.youtube.com/watch?v=wRb7gWNi540">Watch this video on YouTube</a></iframe></p></description></item><item><title>Installing Arduino Library from GitHub</title><link>https://www.baldengineer.com/installing-arduino-library-from-github.html</link><pubDate>Wed, 07 Jan 2015 14:45:58 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=3195</guid><description>What happens when you have a random chip or sensor you want to interface with an Arduino, but don’t know how? You search for a pre-existing library of course. And where are many libraries hosted and available from? A place where eager developers hack together code, post updates, and collaborate with others: Github!&#10;tldr; If you’re having trouble installing a library, look directly at Step 3. Installing a library Many Arduino libraries are available from GitHub. It really fosters the spirit of Open Source work. If you come across a library you need on GitHub, getting it into the Arduino IDE is relatively simple. However, if you’re new to GitHub (or the Arduino IDE) you might miss the simple steps.<p><img src="https://www.baldengineer.com/wp-content/uploads/2015/01/github-library-banner.png" alt="Installing Arduino Library from GitHub"/></p></description></item><item><title>Well formatted Arduino code in one click</title><link>https://www.baldengineer.com/one-click-clean-arduino-code.html</link><pubDate>Fri, 16 May 2014 15:00:06 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=2416</guid><description>Warning, the title of this post is a little bit misleading. It isn’t just one-click to get cleanly formatted code, it’s actually two.&#10;There are two things seasoned programmers will tell new programmers, that they don’t understand (at first):&#10;Always comment your code Properly indent code The problem? As a new programmer, you might not know how to do #2 until you get some experience.&#10;How indenting helps The reason you indent code is to make it easier for a reader to understand the code’s flow. A compiler (well except in Python) doesn’t care if two lines line up or not. T he recent issues around Apple’s “goto fail;” are a great example of how indentation is meaningless to a C compiler.<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/09/autoformat-banner.png" alt="Well formatted Arduino code in one click"/></p></description></item><item><title>Teach your Arduino to listen with µSpeech</title><link>https://www.baldengineer.com/teach-your-arduino-to-listen-with.html</link><pubDate>Tue, 08 Apr 2014 15:00:11 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=2299</guid><description>When most people say “Arduino” they mean an ATmega328 based board like the Uno. This means a simple 8-bit microcontroller with only 2K of RAM. That’s 2,048 bytes of memory to work with. So when someone asked me if the Arduino could do speech recognition, to be honest, I laughed. Then my jaw dropped when I saw µSpeech. A speech recognition library for the Arduino Uno’s ATmega328.&#10;The algorithm used is sophisticated and results will vary based on the types of words used as well as the hardware. It uses only 160 bytes of RAM.<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/09/uSpeech-Banner.png" alt="Teach your Arduino to listen with µSpeech"/></p></description></item><item><title>Arduino: Assignments != Comparisons</title><link>https://www.baldengineer.com/arduino-assignments-do-not-equal-comparisons.html</link><pubDate>Thu, 03 Apr 2014 15:00:59 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=2321</guid><description>There is one mistake that all C programmers make, regardless of experience. You’ll do it often when you get started, but never completely stop. The mistake? Confusing the “assignment” operator with the “comparison” operator. Take a look at this line of code:&#10;if (something = 0) { Notice the problem? If not, then you might fall into this common trap. The most annoying part? A C-Compiler won’t give an error. That code is legal C. Legal code doesn’t mean you’ll get the results you expect. In fact, this is probably not even close to what you wanted. This simple mistake and why it “works” is explained below.<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/09/assignment-comparison-banner.png" alt="Arduino:  Assignments != Comparisons"/></p></description></item><item><title>When do you use the Arduino's Serial.flush()?</title><link>https://www.baldengineer.com/when-do-you-use-the-arduinos-to-use-serial-flush.html</link><pubDate>Thu, 02 Jan 2014 12:00:47 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=2061</guid><description>In the Arduino library, the Serial object has a method called “flush().” Often users go throwing it into programs without fully understanding what it does. It doesn’t help that it’s functionality changed when version 1.0 of the Arduino IDE was released.&#10;Does Serial.flush() affect the Transmit Buffer or the Receive Buffer and when do you need to use it?&#10;What does Serial.flush() do? From the Arduino reference for Serial.flush (found on this page):<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/09/when_to_use_flush_banner.png" alt="When do you use the Arduino&amp;#39;s Serial.flush()?"/></p></description></item><item><title>5 Myths Everyone Believes about Arduino (that aren't true)</title><link>https://www.baldengineer.com/5-arduino-myths.html</link><pubDate>Wed, 01 Jan 2014 12:00:59 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=2232</guid><description>Having spent the past 6 years writing code for the Arduino platform, I’ve noticed a trend in myths from both newcomers and veteran users. Here are the Top 5 Myths I see come up on forums, in classes, and on IRC.&#10;1. The Arduino uses its own Language This myth isn’t helped by the Arduino.cc home page used to say&#10;“T he microcontroller on the board is programmed using the Arduino programming language.”<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/09/arduino_myths_banner.png" alt="5 Myths Everyone Believes about Arduino (that aren&amp;#39;t true)"/></p></description></item><item><title>AddOhms #7 - Comparing Arduino and Raspberry Pi</title><link>https://www.baldengineer.com/addohms-7-comparing-arduino-and-raspberry-pi.html</link><pubDate>Mon, 16 Dec 2013 12:00:59 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=2127</guid><description>The seventh AddOhms TutorialCast has gone “live”. (Gone “uploaded” sounds wrong.) Being able to understand difference between an Arduino and a Pi is a critical point for many new electronics hobbyist. The boards seem so similar, but they are so different. AddOhms #7: Comparing the Arduino and Raspberry Pi&#10;Full Episode Notes are available on the Episode’s homepage.<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/09/addohms-ep7-banner.png" alt="AddOhms #7 - Comparing Arduino and Raspberry Pi"/></p></description></item><item><title>Arduino: De-Bounce a Button with micros() or millis()</title><link>https://www.baldengineer.com/arduino-de-bounce-a-button-with-micros.html</link><pubDate>Fri, 13 Dec 2013 12:25:45 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=2095</guid><description>The Arduino is fast, humans are slow. When you push down a button, what seems like a single change to slow humans is really multiple presses to an Arduino. This is known as “bouncing.” Figure 1 is an oscilloscope screenshot showing what could happen when a button is pressed.&#10;Figure 1 - All the bouncing!&#10;The top trace shows the high-low-high transition of the button press. But notice all of the activity at the start of the high-to-low transition. The bottom trace is a “zoomed-in” view of that area. The button is actually transitioning multiple times before staying low. Internally the contacts are “bouncing.” This could result in false reads. In software, we can ignore these bounces by waiting some period of time after the first transition.<p><img src="https://www.baldengineer.com/wp-content/uploads/2013/12/MG_1763.jpg" alt="Arduino:  De-Bounce a Button with micros() or millis()"/></p></description></item><item><title>Arduino: Chasing LEDs with millis()</title><link>https://www.baldengineer.com/arduino-chasing-leds-with-millis.html</link><pubDate>Thu, 12 Dec 2013 12:00:34 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=2117</guid><description>A popular LED project is the “Larson Scanner.” This scanner emulates the effect seen on KIT from Knight Rider and the Cylons in Battlestar Galactica. The code is usually written using “delay()” which means you can’t combine it with anything else. The following code could be put into a function, called periodically and allow your code to scan while doing other things.&#10;One thing to note, a proper Larson Scanner has some persistence to the next and previous LEDs, this code does not. Maybe that would be a good exercise for the reader?<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/09/millis-chasing-led-larson-scanner-banner.png" alt="Arduino:  Chasing LEDs with millis()"/></p></description></item><item><title>Arduino: Timing Code with Millis() as a Stopwatch</title><link>https://www.baldengineer.com/arduino-timing-code-with-millis-as-a-stopwatch.html</link><pubDate>Wed, 11 Dec 2013 12:25:22 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=2085</guid><description>Since most Arduino boards do not have debug capability, this limits the programmer to using Serial.prints. A useful piece of information might be knowing how long certain parts of code are running. Here’s a simple example that demonstrations:&#10;How to properly use Serial.flush() (hint: it’s for TRANSMIT, not RECEIVE!) How long Serial.print()s can “tie up” the Arduino. At 9600 baud, you’ll see that the Arduino is only busy for about 20 milliseconds in the first chunk of code, but busy for 93 milliseconds in the next. That’s because the Arduino (since 1.0) started using a transmit-buffer. Did you know your code doesn’t wait for a Serial.print to finish?<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/09/millis-code-stopwatch-banner3.png" alt="Arduino:  Timing Code with Millis() as a Stopwatch"/></p></description></item><item><title>Arduino: Independent On-Off Times with Millis()</title><link>https://www.baldengineer.com/millis-ind-on-off-times.html</link><pubDate>Tue, 10 Dec 2013 12:25:29 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=2059</guid><description>When using delay() to flash a LED there is a time for the LED to be on and then off. This makes it easy to have independent control of the “on” and “off” times. The standard blink without delay example doesn’t give you this flexibility.&#10;millis-cookbook-two-duty-cycles&#10;This example code gives you complete independent control of how long a LED (or any OUTPUT pin) stays “ON” or “OFF”. This also demonstrates a very simple two-state state machine.<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/09/millis-ind-on-off-banner.png" alt="Arduino:  Independent On-Off Times with Millis()"/></p></description></item><item><title>Arduino Millis() Examples</title><link>https://www.baldengineer.com/arduino-millis-examples.html</link><pubDate>Mon, 09 Dec 2013 23:00:51 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?page_id=2055</guid><description>You’ve recently learned about millis() and can’t way to delete all of your references to delay(). The problem is that you don’t know quite how to convert your code into millis()-compatible code. Here is a (running) list of millis() examples I’ve put together to help.&#10;Baldengineer’s Arduino millis() Examples Arduino Multitasking - Step by step examples of how to convert delay() code into millis() based code, to simulate multitasking. Police Lights - Flash two LEDs like strobing police lights Control ON and OFF time for a flashing LED. - More control than “blink without delay” Stopwatch Example - Calculate how much time code takes to execute Chasing LEDs - Larson-scanner style chasing pattern De-bounch a button (or switch) - No need for de-bouncing capacitor Delayed events after a button push - Timed events (button push is just example.) analogWrite() PWM Fading - No delay() and a simple function to keep a LED fading with PWM Detect Short and Long Button Press - Give one button multiple functions You might also want to check out my “Blink Without Delay - Line by Line Tutorial.” It is a much more in-depth explanation than the comments provided with the Arduino IDE example.</description></item><item><title>The hidden Arduino Macro F() fixes random lock ups</title><link>https://www.baldengineer.com/arduino-f-macro.html</link><pubDate>Wed, 20 Nov 2013 12:25:33 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=1995</guid><description>It’s 3am but you are not going to bed until you squash this last bug. You sprinkle Serial.print() statements everywhere you can think of, and then that’s when all hell breaks loose: Your code randomly locks up, the LEDs go crazy, and you’ve had it. What’s going on? You’ve run out of RAM!&#10;All of those Serial.print() statements are composed of c-style strings. Which are “constant character arrays.” In order for those arrays to work properly, they get loaded into the ATmega’s RAM before your code starts running. Which can be a problem because 2,048 bytes of RAM doesn’t allow for much.</description></item><item><title>Three Alternatives to Arduino's Serial Monitor</title><link>https://www.baldengineer.com/alternatives-to-arduinos-serial-monitor.html</link><pubDate>Tue, 19 Nov 2013 11:39:29 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=1839</guid><description>The Arduino IDE includes a “Serial Monitor” which is decent for basic serial communication. However, when you need real time serial interaction or data logging capabilities, that’s when one of these serial monitor alternatives can come in handy.&#10;putty [Windows] Download: PuTTY. License: MIT.&#10;Hands-down one of my favorite terminal applications for Windows is PuTTY from Simon Tatham. In addition to being a great serial terminal it can also handle telnet, ssh, and a host of other things (no pun intended). The source is available and looks like it runs on UNIX platforms, but I have never tried. If you’re using Windows, this is probably your best go-to terminal application. Every Windows machine I use gets PuTTY in the Start Menu shortcuts.<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/09/serial-alt-banner.png" alt="Three Alternatives to Arduino&amp;#39;s Serial Monitor"/></p></description></item><item><title>Const vs #define - When do you use them and why?</title><link>https://www.baldengineer.com/const-vs-define-when-do-you-them-and-why.html</link><pubDate>Thu, 14 Nov 2013 11:13:40 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=1944</guid><description>Arduino boards have microcontrollers with notoriously small amounts of RAM. The Uno only has 2,048 bytes of static RAM available for your program to store variables. So when you need to keep non-changing variables out of RAM which is best to use const or #define?&#10;What is #define #define is often misunderstood because it isn’t a programming statement. Instead, it sets up a macro which causes a text replace to occur before code is compiled. For example in this code:</description></item><item><title>Arduino pinMode(): When to use and why</title><link>https://www.baldengineer.com/when-to-use-arduinos-pinmode-and-why.html</link><pubDate>Mon, 11 Nov 2013 11:57:39 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=1923</guid><description>All Arduino boards have GPIO pins with digital and analog capabilities. The Arduino pinMode() function determines how the pins will operate. A surprise might be that in some cases it is not necessary to use it. And when you do, pinMode() may not always work the way you expect. This post outlines how the Arduino pinMode() function works and when you should (or not should) use it.&#10;pinMode(13, OUTPUT); Arduino pinMode() scope This post focuses on the 8-bit AVR Arduino boards such as the Uno, Mega, and Leonardo. The processors on these boards are the ATmega328, ATmega2560, and ATmega32u4, in that order. For the most part, this information does apply to non-AVR and 32-bit Arduino variants. When in doubt, double check with the Arduino Reference pages for details to specific platforms.</description></item><item><title>Sawtooth waveform with the Arduino Due's Built-In DAC</title><link>https://www.baldengineer.com/sawtooth-waveform-with-the-arduino-dues-built-in-dac.html</link><pubDate>Fri, 08 Feb 2013 00:36:18 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=1533</guid><description>Users of the ATmega328 based Arduino boards will recognize that the analogWrite() function doesn’t actually do anything analog. It just sets the duty cycle of a pulse width modulated (PWM) signal. The (new) Arduino Due board, which I have had limited time to play with, actually sports two Analog DAC channels. Using a very simple for() loop, it is possible to generate a sawtooth waveform using these channels.<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/09/sawtooth-banner.png" alt="Sawtooth waveform with the Arduino Due&amp;#39;s Built-In DAC"/></p></description></item><item><title>First impressions of the Arduino Due</title><link>https://www.baldengineer.com/my-first-impressions-of-the-arduino-due.html</link><pubDate>Fri, 23 Nov 2012 04:49:45 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=1392</guid><description>I’ve been working with Arduino boards for a number of years, as shown by the dates on some of my older blog posts. In that time I’ve only used boards based on the ATmega8 (like the Duemilanove or Uno). The Due is the first Arduino board I have used in what I would call the Mega form factor.&#10;Physical Differences I’m surprised by the size difference. I’ve always thought the original Arduino form factor was small, the Due is larger but still feels small.<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/09/due-ports_banner.png" alt="First impressions of the Arduino Due"/></p></description></item><item><title>Arduino: Fixing "Serial Port in Use"</title><link>https://www.baldengineer.com/arduino-fixing-serial-port-in-use.html</link><pubDate>Mon, 08 Oct 2012 09:46:16 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=1207</guid><description>Here’s a couple of quick tips to get around the Arduino IDE error message “Serial Port in Use.” These mostly apply to OSX, but since it is UNIX based, they may make sense for Linux as well.&#10;List Open Files Applies to: OSX, Linux.&#10;The check to see if another process (like a previous run of avrdude) is holding the serial port open is easy on both Linux and OSX. Just open a terminal and run the command: lsof. The command will report back all files that are currently open by the operating system. UNIX-based operating systems do everything through files, so this command is useful to see what is keeping a serial device open. Since lsof gives a list of everything that’s open, and there are a lot of “files”, use grep to only list what is relevant.<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/09/Arduino-Serial-Port-in-Use-Banner.png" alt="Arduino:  Fixing &amp;#34;Serial Port in Use&amp;#34;"/></p></description></item><item><title>Long Overdue LaunchPad Review</title><link>https://www.baldengineer.com/launchpad-review.html</link><pubDate>Sun, 30 Sep 2012 14:13:26 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=1259</guid><description>Recently I realized most of my projects were all Arduino-based. There are lots of other prototyping platforms available in the market, and the TI LaunchPad, based on the MSP430 is one of them. In fact, I have had one of these boards sitting in my box of stuff ever since they came out. At $5, they because an impulse purchase when I was buying some other stuff.</description></item><item><title>Raspberry coming to a Hackerspace near you</title><link>https://www.baldengineer.com/raspberry-coming-to-a-hackerspace-near-you.html</link><pubDate>Mon, 20 Aug 2012 09:58:51 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=1175</guid><description>One of the Raspberry Pi Foundation’s developers, Rob Bishop, is heading out on a Hackerspace tour in the US. Looks like he’ll be visiting a couple of spaces on the west coast, east coast, and my home town: Austin, TX.&#10;[Via raspberrypi.org Raspberry Pi Foundation US Hackspace Tour | Raspberry Pi]</description></item><item><title>Renesas Promotion Board for RL78/G13 | Renesas Electronics America</title><link>https://www.baldengineer.com/renesas-promotion-board-for-rl78g13-renesas-electronics-america.html</link><pubDate>Wed, 15 Aug 2012 10:42:23 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=1083</guid><description>Renesas is offering a promotion version of their RL78 microcontroller. This offer is only available to their Sample Component account holders, but the process for signing up for a sample account is pretty straightforward. (There may be EAR restrictions with this board.)&#10;If you are looking for a powerful processor that is an alternative to PIC or AVR processors, this board might be worth a look.&#10;Note: It appears samplecomponents.com might have been compromised at some point in the past. Google throws a warning page up. Proceed at your own discretion.<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/08/RL78_Kit_sm.jpg" alt="Renesas Promotion Board for RL78/G13 | Renesas Electronics America"/></p></description></item><item><title>Arduino: Getting Real Time Help</title><link>https://www.baldengineer.com/arduino-getting-real-time-help.html</link><pubDate>Mon, 13 Aug 2012 09:30:08 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=1155</guid><description>Note: The IRC Channel (along with all of Freenode) got nuked.&#10;While the Arduino Project Team provides their official Arduino forums, sometimes real-time help is just a bit better. When that is the case, I encourage you to visit the freenode.net IRC channel, #arduino. While as of today it is not an official channel, there are a number of great people available to help.&#10;You can find me under the nick “baldengineer”, big surprise, I know. Others like kline, Yoston and pwillard are also excellent people to ping with questions.<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/09/Screen-Shot-2012-08-12-at-9.03.39-PM.png" alt="Arduino:  Getting Real Time Help"/></p></description></item><item><title>Arduino: Sending and Receiving Multi-Digit Integers</title><link>https://www.baldengineer.com/arduino-multi-digit-integers.html</link><pubDate>Mon, 30 Jul 2012 09:18:32 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=1105</guid><description>When Serial data is transmitted to an Arduino, it is sent one byte at a time. Even though you might type “123” in the Serial Monitor, that’s not quite what is sent. Instead the bytes “1” then “2” then “3” are sent. Once received into a buffer on the Arduino, these individual bytes need to be reassembled into something useful. The Arduino IDE provides Serial.readBytes() as one option. However, if you aren’t sure how many digits you are going to receive, this may not work. So another option is to use Serial.readBytesUntil() like so:<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/07/Serial-Monitor-123.png" alt="Arduino:  Sending and Receiving Multi-Digit Integers"/></p></description></item><item><title>Arduino: Toggling Outputs</title><link>https://www.baldengineer.com/arduino-toggling-outputs.html</link><pubDate>Mon, 23 Jul 2012 09:00:13 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=1072</guid><description>Did you know it is possible to toggle the state of a Arduino OUTPUT pin using a single line of code? It’s true! It’s also possible to use digitalRead() on an OUTPUT pin. Assuming pin 13 was set to output, this single line of code will cause the LED to change state (or flash) each time it is called:&#10;digitalWrite(13, !digitalRead(13)); Keep reading to understand how these two tricks work.<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/07/picasion.com_59157f597d88f4db5519afff49288894.gif" alt="Arduino:  Toggling Outputs"/></p></description></item><item><title>Arduino: How do you reset millis() ?</title><link>https://www.baldengineer.com/arduino-how-do-you-reset-millis.html</link><pubDate>Mon, 16 Jul 2012 14:00:42 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=861</guid><description>The quick answer to “How do you reset millis()” is: You Don’t! And here’s why: if you did, it would potentially break most libraries and functions that rely on it. Generally the reason people want to reset it, is that they are concerned about rollover. Instead of focusing on resetting millis(), here is how to use it correctly.&#10;Need to brush up on how millis() works? I’ve got a tutorial on how to effectively multi-task with millis() and another line-by-line tutorial on blink Without delay Avoiding rollover and checking how much time as passed is done in a single line:<p><img src="https://www.baldengineer.com/wp-content/uploads/2012/07/stopwatch_000018042439.jpg" alt="Arduino:  How do you reset millis() ?"/></p></description></item></channel></rss>