I tried the exact thing shown in the video, https://www.youtube.com/watch?v=5LbgyDmRu9s#t=288
My code is as follows:
Code: Select all
#test py
import pyb
pyb.Led(1).On()
print ("hello ")
Code: Select all
python3 pyboard.py test.py
Now lets say I have the following code:
Code: Select all
#test.py
import pyb
print("starting")
sw = pyb.Switch()
rtc = pyb.RTC()
rtc.datetime((2014, 9, 1, 4, 13, 0, 0, 0))
print(rtc.datetime())
T = rtc.datetime()
while True:
T = rtc.datetime()
if T[7] < 127:
S = "%04d/%02d/%02d %02d:%02d" % (T[0],T[1],T[2],T[4],T[5])
else:
S = "%04d/%02d/%02d %02d %02d" % (T[0],T[1],T[2],T[4],T[5])
print (S)
pyb.LED(1).toggle()
pyb.delay(1000)
There is a permanent loop in this one and I get no output. Is there a way I can do this and still get the live output?
Im trying to develop with writing to files and the only other way I can see is as follows
1. I copy the py file to the device
2. reset it without hard drive access from the pc
3. check on repl for the debug output
4. modify the file on the pc
5. reset the pyboard again with hard drive access
6. start from 1 again.