User Tools

Site Tools


using_the_serial_port_march_2013

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
using_the_serial_port_march_2013 [2013/03/14 11:01] tomgeeusing_the_serial_port_march_2013 [2013/03/14 11:35] (current) tomgee
Line 1: Line 1:
 +===== USE THE SERIAL PORT IN SOFTWARE =====
 +By default, the serial port is configured as a console port for interacting with the Linux OS shell.  If you want to use the serial port in a software program, you must disable the OS from using this port. 
 +
 ===== Serial Library ===== ===== Serial Library =====
 WiringPi includes a simplified serial port handling library. It can use the on-board serial port, or any USB serial device with no special distinctions between them. You just specify the device name in the initial open function. WiringPi includes a simplified serial port handling library. It can use the on-board serial port, or any USB serial device with no special distinctions between them. You just specify the device name in the initial open function.
Line 60: Line 63:
  
 /* /*
- * serialTest.c: + * serialTest.c:\\ 
- * Very simple program to test the serial port. Expects + * Very simple program to test the serial port. Expects\\ 
- * the port to be looped back to itself + * the port to be looped back to itself\\ 
- * + *\\ 
- */+ */\\
  
-#include <stdio.h> +#include <stdio.h>\\ 
-#include <string.h> +#include <string.h>\\ 
-#include <errno.h>+#include <errno.h>\\
  
-#include <wiringPi.h> +#include <wiringPi.h>\\ 
-#include <wiringSerial.h>+#include <wiringSerial.h>\\
  
 int main () int main ()
Line 116: Line 119:
   return 0 ;   return 0 ;
 } }
 +
 +===== Hardware Level Converter Hookup =====
 +
 +{{:raspi-rs232-schematic2.png|}}
 +
using_the_serial_port_march_2013.1363273295.txt.gz · Last modified: 2013/03/14 11:01 by tomgee