I'm relatively new to C# and have no formal programming experience so apologies in advance if the way I do things are bad practice etc - I generally implement things in a way which seems logical to me! As a small project I'm making a toy car which can drive
itself, the problem I've currently got is reading data from two serial port devices at once. The way I tend to work is to write smaller applications to do one function and get that working before integrating it into a larger application which will pull all
the functions together.
I've written a "Serial_Port_Communications" class which allows you to pass a serial port object into it and then perform some typical functions: open a port, close it, read data, write data etc. Thats common code across all of my serial devices (they all
need to do the same operation so why re-write it?)
Then for each device I've got a class which handles the operations and data specific to it: GPS & Compass. Each of those two create instances of the Serial_Port_Communications class.
In the GPS & Compass classes, they each have a SerialPort object which has an eventhandler assigned to it for when data is received e.g GPS.datareceived += & Compass.datareceived +=...
They each work flawlessly when they run as the mini-applications i.e. I can Parse the GPS data that is received and I can read
View Complete Post