Closed casey-SK closed 2 years ago
I tested the following program, and it worked fine:
import picostdlib/[gpio, time, stdio]
stdioInitAll()
let led = 20.Gpio
led.init()
led.setDir(Out)
while true:
led.put(High)
sleep(1500)
led.put(Low)
print("blink")
sleep(1500)
Bump the nimble version and update all examples. Perhaps we should make picostdlib
import and export all submodules.
would that mean you would just use
import picostdlib
and never have to worry about importing individual submodules?
Indeed, it'd export all sub modules making life easier if wanted.
do you think we want that, or do we want granular control? would there be a difference in size of the .uf2 file? I assume that Nim does not compile/import procs and modules which are never used in the main program?
It was just an idea. It does not compile code that's not needed, only code that's used. We can just remove the main module I think if it's not needed.
I suppose to be idiomatic like the Nim standard library, we should just have one module imported?
I mean you can selectively import if needed, it's not really idiomatic, just an option.
I plan on making another PR very soon that will completely overhaul the examples folder. Can we have broken examples for a little bit and approve this PR?
Sounds fine for now, if you do not get the examples overhauled in due time I'll fix it myself.
sounds good!
I placed
sleep()
andsleepMicroseconds
into thetime.nim
module and moved all of the other proc's insidepicostdlib
intostdio.nim
. Personally, I prefer it this way, and believe it is more consistent across the board.I was not sure what effects deleting the
picostlib.nim
file would do tonimble install
as a hybrid installation, so I didn't delete it yet.