Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <boost/asio/serial_port.hpp>
- using namespace::boost::asio;
- int main()
- {
- io_service io;
- serial_port port( io, "COM3" );
- port.set_option( serial_port_base::baud_rate( 19200 ) );
- unsigned char commands[4] = { 1, 128, 240, 0 };
- // write the commands to the device
- return 0;
- }
- boost::asio::write(port, boost::asio::buffer(commands, 4));
Add Comment
Please, Sign In to add comment