Arduino Delphi Serial Communication Port

Leave a comment

Ah, Arduino, I remember when you were just crawling around and blinking LEDs. Now you're ready to learn how to speak!

The system uses a dedicated serial link, leaving the Arduino's 'main' serial link dedicated to programming the Arduino and communicating with the Arduino Development Environment's serial monitor. But again, it would be trivial to 'move' the serial link to pins D0 and D1, if you wished to.

In this lesson we'll learn how to use the Serial Library to communicate from the Arduino board back to the computer over the USB port. Then we'll learn how to manipulate numbers and data. For this lesson we won't be using the shield, so simply remove it (keeping the mood light LEDs on it you'd like).

The shield doesn't contain any programs or data, it is just our way of connecing up the LEDs and resistors. We'll use the shield again but for now, we can examine the RX and TX LEDs on the main Arduino board which will help you with debugging. Libraries are great places, and not yet illegal in the United States!

If you ever need to learn how to do something, like say fix a motorcycle, you can go to your local library and take out a book. Sure you could buy the book but the library is nice because as a resource you can get the book whenever you need it, keeping your house uncluttered. Software Libraries are very similar. We already studied what a procedure is, in: a procedure is a list of things to do. A library is a big collection of procedures, where all the procedures are related! If you, say, want to control a motor, you may want to find a Motor Control Library: a collection of procedures that have already been written for you that you can use without having to do the dirty work of learning the nuances of motors.

06 Mobster's Anthem.flac 39.8 MB 10 Korrupt World.flac 39.15 MB 12 No Remorse.flac 36.71 MB 09 Unsolved Mystery.flac 35.8 MB 13 Emotions [Remix].flac 35.15 MB 08 Emotions.flac 33.76 MB 03 Death Before Dishonor.flac 32.44 MB 05 Overdose.flac 31.41 MB 11 Get It Wet.flac 31.22 MB 02 Adrenaline Rush.flac 28.25 MB 04 - It Feels So Good.mp3 14.08 MB 01 Intro.flac 13.92 MB 07 Get Her in tha Mood.flac 6.86 MB Adrenaline Rush [Spectro] [FLAC].png 242.84 KB Adrenaline Rush [Spectro] [MP3].png 226.5 KB Twista_Adrenaline_Rush.jpg 30.94 KB. Tracklist Intro 2:04 Adrenaline Rush 3:43 Death Before Dishonor 4:23 It Feels So Good 6:08 MP3 @ 320 Overdose 4:16 Mobster's Anthem 5:07 Get Her In Tha Mood 1:29 Emotions 4:32 Unsolved Mystery 4:45 Korrupt World 5:40 Get It Wet 4:03 No Remorse 4:32 Emotions (Remix) 4:49 Twista Real Name: Carl Terrell Mitchell Profile: American hip-hop emcee, once the world-record holder for the fastest ever, born on November 27, 1973, in Chicago Illinois. Rush

The library we will be using is the Serial Library, which allows the Arduino to send data back to the computer. Serial may sound like a tasty breakfast food, but its actually quite different. The word serial means 'one after the other.' For example, a serial killer doesn't stop with one murder, but stabs many people one after the other. Serial data transfer is when we transfer data one bit at a time, one right after the other. Information is passed back & forth between the computer and Arduino by, essentially, setting a pin high or low. Just like we used that technique to turn an LED on and off, we can also send data.

One side sets the pin and the other reads it. It's a little like, where you can use dits and dahs to send messages by In this case, instead of a long cable, its only a few feet. This is as good as Microsoft Visio can do, yay! (Now, people who are all geeked-out will probably get angry at this point because I'm simplifying things. Well guess what, its an Arduino tutorial, not a OSI Physical Network Architecture tutorial.).

The world isn't run by weapons anymore, or energy, or money. It's run by little ones and zeroes, little bits of data.

Arduino Delphi Serial Communication Port

It's all just electrons. - Sneakers Now is a good time to review how data is measured. For example, we measure weight with 'ounces' and 'pounds' (or grams and kilograms) and distances with 'inches,' 'feet,' and 'miles' (or centimeters, meters and kilometers). Information has its own system of measurements: A single bit is either a zero or a one. You can group bits together into 8 bits which is 1 byte.

1024 bytes (8192 bits) is one Kilobyte (sometimes written KB). 1024 KB (1048576 bytes) is one Megabyte (MB) 1024 MB is 1 Gigabyte (GB) An interesting thing to note is while 1000 grams is a kilogram, nearly all computer systems consider 1024 bytes to be a kilobyte. That is, a 1.0 Kilobyte file on your computer is 1024 bytes: Quick quiz! If your hard disk is 200 Gigabytes, how many bytes is that? Use a calculator with lots of digits! Highlight the text below for the answer 200 GB * 1024 = 204800 MB 204800 MB * 1024 = 209715200 KB 209715200 KB * 1024 = 00 bytes!

Hard drive makers are quite sneaky, you'll notice that they define GB as being 1000 MB, and 1 MB = 1000 KB, etc. Given this fact, how many bytes can you really store in your 200GB drive? Highlight the text below for the answer 200 GB * 1000 = 200000 MB 200000 MB * 1000 = 200000000 KB How much less storage do you get thanks to the marketing guy who came up with this trick? Highlight the text below for the answer About 4.6% less than you'd expect. We've actually used the Serial communications capability already quite a bit.that's how we send sketches to the Arduino! When you Compile/Verify what you're really doing is turning the sketch into binary data (ones and zeros).

When you Upload it to the Arduino, the bits are shoved out one at a time through the USB cable to the Arduino where they are stored in the main chip. Next time you upload a sketch, look carefully at the two LEDs near the USB connector, they'll blink when data is being transmitted. One blinks when the Arduino is receiving data (RX) and one blinks when the Arduino is transmitting data ( TX). If there's no library name, it means that the procedure is in the 'default' collection of procedures we use. For example, delay() is so common, the designers of the Arduino software didn't bother putting it into a library. So there's some mystery procedure that's called begin, well it's not too tough to figure out what it might do. It's the procedure that gets the Serial stuff ready.