Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Control Blocks in Makecode?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Control Blocks in Makecode?

by V2man on Fri Nov 15, 2019 6:23 pm

Can anyone show an example of using Control Block timers in Makecode for CPX?

V2man
 
Posts: 704
Joined: Mon Dec 03, 2018 12:38 am

Re: Control Blocks in Makecode?

by kcl1s on Fri Nov 15, 2019 8:18 pm

I have never used them before but here is a quick example using them. https://makecode.com/_gfcbLPf4PhEg I guess they could be useful for tracking multiple timers.

Fellow hobbyist
Keith

kcl1s
 
Posts: 1511
Joined: Tue Aug 30, 2016 12:06 pm

Re: Control Blocks in Makecode?

by kcl1s on Fri Nov 15, 2019 8:35 pm

Here is one using multiple timers. https://makecode.com/_hAqTfLb7mXzU

Keith

kcl1s
 
Posts: 1511
Joined: Tue Aug 30, 2016 12:06 pm

Re: Control Blocks in Makecode?

by V2man on Sat Nov 16, 2019 3:07 am

Thanks @ kcl1s
I am not sure if I will use timers but I wanted to compare them with what you can do with pause and wait in the future and see how fast I could go before they broke down. Timers are very dependent on a power on reset initialization. That means if the program gets hung up you will have to manually push the reset button.
I made a complex pulse with them.

Using Timers Plot.PNG
Using Timers Plot.PNG (29.46 KiB) Viewed 146 times


Using Timers.PNG
Using Timers.PNG (134.29 KiB) Viewed 146 times
Attachments
Using-Timers.uf2
(273 KiB) Downloaded 10 times

V2man
 
Posts: 704
Joined: Mon Dec 03, 2018 12:38 am

Re: Control Blocks in Makecode?

by V2man on Sat Nov 16, 2019 4:53 pm

Lost a set P2 to 1 under one of the if statements under function T2.

V2man
 
Posts: 704
Joined: Mon Dec 03, 2018 12:38 am

Please be positive and constructive with your questions and comments.