C++ code to use an arduino as a TTL generator