There are also semaphores which are the beginnings of telegraphy that eventually evolved into the internet. Here’s a book about our first telegram president, who was much better than our Twitter president. And here’s a book with the history of telegraphy comparing it to the modern internet. But it all started with flags as letters. Fun fact, semaphores are also a thing in programming. It’s flags all the way down.
Most well researched books on the Civil War mention the use of the telegraph, but there are a few online and hard copy resources out there. These should help get your started.
http://www.amazon.com/Mr-Lincolns-T-Mails-Abraham-Telegraph/dp/0061129801
https://en.wikipedia.org/wiki/U.S._Military_Telegraph_Corps
http://civilwarstudies.org/articles/Vol_8/situation-room.shtm