<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Serial on Bald Engineer</title><link>https://www.baldengineer.com/tag/serial</link><description>Recent content in Serial on Bald Engineer</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 28 Apr 2020 06:01:34 +0000</lastBuildDate><atom:link href="https://www.baldengineer.com/tag/serial/index.xml" rel="self" type="application/rss+xml"/><item><title>Sending simple serial commands to an Arduino</title><link>https://www.baldengineer.com/simple-serial-commands-arduino.html</link><pubDate>Wed, 01 Mar 2017 15:00:16 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=6376</guid><description>Sending simple serial commands to an Arduino is the easiest way to communicate between an Arduino and a computer. The computer could be a PC, a Raspberry Pi, or any device that communicates with serial.&#10;By sending and “decoding” a single character it is easy to add a simple debug menu or even serial menu. Plus, it is easy to extend.&#10;Single Character vs. Full Words The mistake I see many people make is that they try to send full-text strings as serial commands. For example, to turn on a LED, I have seen (silly) commands like “RED LED ON” or “RED LED OFF.” While you could use something like strcmp(), as I showed on the Multiple MQTT Topics example, that tends to be overkill for most serial commands.<p><img src="https://www.baldengineer.com/wp-content/uploads/2017/03/sending-simple-serial-commands-arduino-banner.jpg" alt="Sending simple serial commands to an Arduino"/></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>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>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></channel></rss>