Closed ircbloqcc closed 2 years ago
You are right. The code should be like this:
from microbit import *
test = 0
test = 0
def repeat():
if button_a.is_pressed():
on_button_a()
def on_button_a():
global test
test += 1
while True:
repeat()
I will fix this soon.
While adding change variable blocks in custom block, global keyword should add. but in OB is not happening. so it gives error.
Expected Behavior
def on_button_a(): global test test += 5
def on_pin0(): global test test += 20`
Actual Behavior
i have tried with python code. that also gives error.