microbit = codesters.Microbit()
microbit.show_string("hello")
data = microbit.get_temp()
microbit.show_number(data)
data_list = []
time_list = []
my_display = codesters.ScatterPlot(time_list, data_list)
time = 0
def interval():
data = microbit.get_temp()
data_list.append(data)
stage.event_interval(interval, 2)
t = codesters.Teacher()
try:
param = t.find_text('global')
tval1 = param[0][1]
tval2 = t.get_indent_at_line(param[0][0])
except:
tval1 = "DNE"
tval1a = "DNE"
tval2 = "DNE"
t1 = TestObjective()
t1.add_success('time' in tval1 and tval2 == 4, "Great job!")
t1.add_failure(tval1 == "DNE", "Oops! Did you drag in Global Variable?")
t1.add_failure('my_var' in tval1, "Make sure the global variable name is time.")
t1.add_failure(tval2 == 0, "Oops! Did you indent your global variable 4 spaces inside your interval event?")
t1.add_failure('time' not in tval1, "Make sure your global variable name is time.")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()