Created
December 10, 2013 13:20
-
-
Save anonymous/7890458 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdafx.h" | |
#include <stdio.h> | |
#include <conio.h> | |
#include "tserial.h" | |
#include "bot_control.h" | |
serial comm; //serial is a class type defined in these files, used for referring to the communication device | |
void main() { | |
char data; //To store the character to send | |
printf("Enter character to be sent"); //User prompt | |
scanf("%c",&data); //User input | |
comm.startDevice("COM2", 9600); | |
/* “COM 2” refers to the com port in which the USB to SERIAL port is attached. It is shown by right clicking on my computer, then going to properties and then device manager | |
9600 is the baud-rate in bits per second */ | |
comm.send_data(data); //The data is sent through the port | |
comm.stopDevice(); //The device is closed down | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment