Open randmor opened 6 years ago
Seems GitHub is not Python friendly when it comes to comments in the source code. Seems to want to interpret '#' as some kind of format character. Here's the code again stripped of comments:
` from microbit import * import time import DS1302
def xlateDayCode(day): if day == 0: return 'Sunday' elif day == 1: return 'Monday' elif day == 2: return 'Tuesday' elif day == 3: return 'Wednesday' elif day == 4: return 'Thursday' elif day == 5: return 'Friday' elif day == 6: return 'Saturday' else: return 'Error'
ds = DS1302.DS1302(clk=pin13, dio=pin14, cs=pin15)
while True:
display.scroll('Today is ' + xlateDayCode(ds.Weekday()) + ', ')
display.scroll(str(ds.Month()) + '/' + str(ds.Day()) + '/' + str(ds.Year()))
time.sleep_ms(1000)
display.scroll(str(ds.Hour()) + ':' + str(ds.Minute()) + ':' + str(ds.Second()) + ' ')
time.sleep_ms(10000) # Wait 10 seconds & repeat...
`
Now tab indents are gone.