This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
ruby '2.6.3' | |
gem 'rake', '~> 12.3.3' | |
gem 'minitest', '~> 5.11.3' | |
gem 'minitest-reporters', '~> 1.3.8' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from https://github.com/fizban99/microbit_ssd1306 | |
from microbit import i2c, Image | |
OLED_ADDR = 0x3c | |
oled_screen = bytearray('b\x40') + bytearray(512) | |
def oled_initialize(): | |
for c in ([0xae], [0xa4], [0xd5, 0xf0], [0xa8, 0x3f], [0xd3, 0x00], [0 | 0x0], [0x8d, 0x14], [0x20, 0x00], [0x21, 0, 127], [0x22, 0, 63], [0xa0 | 0x1], [0xc8], [0xda, 0x12], [0x81, 0xcf], [0xd9, 0xf1], [0xdb, 0x40], [0xa6], [0xd6, 1], [0xaf]): | |
i2c.write(OLED_ADDR, b'\x00' + bytearray(c)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from microbit import i2c | |
RTC_ADDR = 0x68 | |
def bcd2bin(v): | |
return v - 6 * (v >> 4) | |
def bin2bcd(v): | |
return v + 6 * (v // 10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# To install in Xcode, add "New Run Script Phase" to the target "Build Phases" | |
TAGS="TODO:|FIXME:" | |
echo "searching ${SRCROOT} for ${TAGS}" | |
find "${SRCROOT}" \( -name "*.h" -o -name "*.m" -o -name "*.swift" \) -print0 \ | |
| xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" \ | |
| perl -p -e "s/($TAGS)/ warning: \$1/" |