I am relatively new to arduino and coding in general and im just looking for a code to write a single string of binary code e.g.; "01000111101" To a specified output pin instead of copying and pasting
"Digital write (high) Digital write (low) Etc."
preferably with the option to change speed between bits. Would be very appreciative for someone to help me out
1 Answer 1
If timing is not critical, consider dividing the number of interest by 2. If there was a remainder set the Arduino pin to 1. If not set it to 0. Then delay for as long as needed. Keep doing this until there is nothing left to divide 2 into.
However, sending out data in serial fashion is as old as computers. Likely older. Consequently there are a lot of built in features which do this. Specifically, it is not necessary to explicitly code up a function to convert a value to serial data. Even on an Arduino.
for
loops for generating an index value