kaka_yan 发表于 2018-9-13 10:57:05

小女孩的Micro:bit手表

本帖最后由 kaka_yan 于 2018-9-13 10:57 编辑

      Micro:bit的体积比较小,用来做穿戴就最合适了,这次小朋友尝试做一个手表,有以下功能:1、可以设定并显示时间;2、可以指示方向,箭头所指方向为北向;3、可以计步数。

零件清单如下:Microbit开发版1块、电池盒1个、5号电池2个、亚克力外壳1个、橡皮筋1盒、卡纸一张。




制作步骤:






freedomzjsx 发表于 2018-10-17 14:27:46

如何显示时间?需要时钟模块吧?

huiop 发表于 2018-9-15 20:47:12

程序呢,我关心程序

rzyzzxw 发表于 2018-9-17 09:28:06

支持,很好看的。{:5_148:}程序+1.;P

gada888 发表于 2018-9-19 17:32:02

满有爱

MakeIt 发表于 2018-10-2 02:46:19

程序,程序,分享分享

棍刃游 发表于 2020-3-12 08:58:11

我有java版
但只能看时间,调时间,没那么多功能
let ampm = false
let hours = 0
let adjust = 0
let time = ""
let minutes = 0
input.onButtonPressed(Button.AB, function () {
    ampm = !(ampm)
})
input.onButtonPressed(Button.A, function () {
    if (hours < 23) {
      hours += 1
    } else {
      hours = 0
    }
})
input.onGesture(Gesture.Shake, function () {
    adjust = hours
    if (ampm) {
      if (hours > 12) {
            adjust = hours - 12
      } else {
            if (hours == 0) {
                adjust = 12
            }
      }
    }
    time = "" + adjust
    time = "" + time + ":"
    time = "" + time + minutes / 10
    time = "" + time + minutes % 10
    if (ampm) {
      if (hours > 11) {
            time = "" + time + "PM"
      } else {
            time = "" + time + "AM"
      }
    }
    basic.showString(time)
})
input.onButtonPressed(Button.B, function () {
    if (minutes < 59) {
      minutes += 1
    } else {
      minutes = 0
    }
})
basic.forever(function () {
    basic.pause(60000)
    if (hours < 59) {
      minutes += 1
    } else {
      minutes = 0
      if (hours < 23) {
            hours += 1
      } else {
            hours = 0
      }
    }
})

auzn 发表于 2020-4-11 19:53:49

厉害啊 厉害
页: [1]
查看完整版本: 小女孩的Micro:bit手表