ardupilot/libraries/AP_OSD/fonts/mcm2bin.py

22 lines
372 B
Python
Raw Normal View History

2018-06-23 04:11:05 -03:00
#!/usr/bin/python
import sys;
if len(sys.argv) < 3:
2018-07-03 19:28:58 -03:00
print "Usage: ./mcm2bin.py clarity.mcm clarity.bin"
2018-06-23 04:11:05 -03:00
exit()
with open(sys.argv[1]) as inp:
content = inp.readlines()
inp.close();
content.pop(0)
out = open(sys.argv[2], 'wb')
i = -1
for line in content:
i = i + 1
if i % 64 < 54:
b = int(line, 2)
out.write(bytearray([b]))
out.close()