fastspin Basic simple stuff
Rsadeika
Posts: 3,837
in Propeller 1
This is really straight forward stuff, or so I thought. When I run the program I expect the LED to turn on, it does not. When I add the pausems 4000, then the LED stays on for four seconds, and turns off. What do you have to do too keep the LED on, and then give it another command to turn it off.
Ray
Ray
const pin = 26 direction(pin) = output output(pin) = 1 ' LED turns on. 'pausems 4000
Comments
You can add an empty to keep the cog twiddle its thumbs forever.
Not sure if I could tweak the code, and besides if you did tweak it, how would you be able to run the tweaked code.
Ray
Ray
Mike R.
Fits using LMM: Error with "--code=cog":
The problem with BASIC's "print" has a different flavour.
Let's ask the master: @ersmith ;-)
Yes, most certainly he'll know.
Mike R.
Yes. Actually any attempt to call a function through a pointer will fail with --code=cog on P1. I don't think I will fix that, but I will add an error. (The root cause is the calling convention for COG code; on P1 doing "call #foo" actually generates "jmpret foo_ret, #foo". This doesn't support indirect calls. It is possible to generate the "jmpret" directly, but it would have to be done for all functions and would make the COG code a lot less readable, and it's an edge case (--code=cog isn't really practical for BASIC code anyway).
Getting a hint what's going on will be enough in this context.
Thanks!