7/28/21
Hi guys, I'm heading to norcal to visit some friends so I had to work pretty quickly. I was able to create a constant oval block to output Micros(). I don't have an arduino handy so I haven't been able to check it, but it seems to compile okay. Regarding the actual block, I just used one of the pre-existing oval shapes to save time lol, although, I DID have to manually input it into blocks_compressed.js. Regarding the logic, as micros() already exists, that part wasn't that difficult. No actual logic programming, just linking things together. micros links to micros(), so, yeah, wasn't too difficult.
Manipulating the C output in arduino_compressed.js can allow for some pretty nifty utilizations for micros() or millis() for that matter to do other things as well, but the way I designed it is simply to begin the timer to go until it hits a certain microsecond, then perform the "do" task.
I wish I can test this out on an actual arduino, but probably have to wait until next Tuesday.
Anyway, please let me know if I did something wrong, or if I deviated from the assignment. I BELIEVE you can use a function within an if statement in C, if I'm wrong, then darn lol, it's going to require some re-working. Would love to know thoughts!
I will take the rest of the week to see the how/why/what of the compression method.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Nice, Dante! Did you try the method of creating a js file for the block as well?
Are you sure? yes | no
Ah, that's right. I should've done that, I'll do it shortly! (I'm assuming you mean me, though, lol)
Are you sure? yes | no
Ah yes, you haha
Are you sure? yes | no
So fast! wow haha
Are you sure? yes | no
haha I want to enjoy my weekend :). let me konw if you found a better way to implement millis(), millis() and micros() is like... nearly identical in a lot of ways haha.
Are you sure? yes | no
On that note, actually, as Dante saw some discrepancies from arduino_compressed.js and what he compressed himself. I'm inclined to think Mr. Andrew gulp'ed it and then changed things in arduion_compressed.js to further fine-tune. Will look more into this!
Are you sure? yes | no