better music support

This commit is contained in:
Peli de Halleux
2016-03-14 08:32:02 -07:00
parent 53c3b22c1c
commit 4cd222ec82
4 changed files with 36 additions and 8 deletions

View File

@@ -219,7 +219,7 @@ namespace ks.rt.micro_bit {
let v = '';
if (pin.mode & PinMode.Analog) {
v = Math.floor(100 - (pin.value || 0) / 1023 * 100) + '%';
if(text) text.textContent = (pin.value || 0) + "";
if(text) text.textContent = (pin.period ? "~" : "") + (pin.value || 0) + "";
}
else if (pin.mode & PinMode.Digital) {
v = pin.value > 0 ? '0%' : '100%';