Changed data types

Changed data types so methods and variables can be ported more easily.
Updating main function

Implemented support to control enable/disable Rs485 enable pin.