第 13 步:现在我们有了时间和温度,我们可以开始绘图了!

  • 在主题中,转到并将Update Scatter Plot拖到间隔事件中。
  • 将更新命令的第一个参数从x_datatime_list
  • 将更新命令的第二个参数从y_datadata_list
  • 点击运行。然后点击提交接下来继续。

To navigate the page using the TAB key, first press ESC to exit the code editor.

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) global time time_list.append(time) stage.event_interval(interval, 2)
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)