PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
327B

  1. % Talkie library
  2. % Copyright 2011 Peter Knight
  3. % This code is released under GPLv2 license.
  4. %
  5. % Emit a parameter as bits
  6. function bitEmit(val,bits)
  7. bitpos = 2^(bits-1);
  8. for b = 1:bits
  9. if bitand(val,bitpos)
  10. printf('1');
  11. else
  12. printf('0');
  13. end
  14. val = val*2;
  15. end