小编jes*_*537的帖子

微:蓝牙低功耗黑客持久性(高中实习项目)

我的项目是使用Micro:bit微处理器创建一个交互式程序我正在构建一个游戏,它使用钻孔马达作为控制器,读取旋转方向和速度作为控制输入,但我的导师也说很酷在游戏运行的同时为电路板供电,所以现在我遇到了这样的情况,一旦我停止转向改变方向或我的速度低于传输3.3伏电源,然后游戏重新启动,我失去了所有进展

我有使用第二个micro:bit作为一种由我的电脑供电的存储位置的想法,并且两个不断通信的发送回播放器位置和LED上的其他对象

但我无法弄清楚如何让两个Micro:bit互相交谈

如果有人可以指出我正确的方向,甚至建立某种沟通方式,在我开始前进的过程中向我推进正确的方向

我是一个高中学生,我不会像我假装的那样知道,所以我可能需要很多帮助(我比我班上的大多数人都更先进,所以把我当作一个技术天才少年投入与大学生一天天失去我不应得的自我LOL)请帮助我不知何故我目前完全失去

bluetooth-lowenergy micropython bbc-microbit

4
推荐指数
1
解决办法
568
查看次数

Python多个海龟同时移动(看似)

我正在为我的老师测试一些东西,他想看看如果我们模拟同步时下面的程序可能运行得更快(我知道它不能完全同步,这只是为了学习/练习)多只乌龟的运动.我已经尝试过使用多处理,线程等模块,甚至还有一些疯狂的愚蠢尝试时间和延迟(我在高中时因为之前的一个问题我刚刚在python学习了一些问题)许多失败的尝试我都在问,是否有人想知道还有什么可尝试的,或者是一个方向来模拟海龟的同步运动

从乌龟进口龟进口龟

turtle.getscreen().delay(0)
class MyTurtle(Turtle):
    def petal(self):
        for i in range(90):
            self.fd(1)
            self.rt(1)
        self.rt(90)
        for i in range(90):
            self.fd(1)
            self.rt(1)

    def stem(self):
        self.pencolor('green')
        self.fd(250)

    def flowerhead(self):
        for i in range(9):
          self.pencolor('red')
          self.begin_fill()
          self.petal()
          self.lt(230)
          self.end_fill()

    def stempetal(self):
        self.seth(90)
        self.rt(15)
        self.fillcolor('green')
        self.begin_fill()
        self.petal()
        self.end_fill()



tony = MyTurtle(shape='turtle')
todd = MyTurtle(shape='turtle')
tina = MyTurtle(shape='turtle')
tiny = MyTurtle(shape='turtle')
tweeny = MyTurtle(shape='turtle')


def flower1():
    todd.speed('fastest')
    todd.fillcolor('blue')
    todd.flowerhead()
    todd.seth(270)
    todd.stem()
    todd.stempetal()

def flower2():
    tony.speed('fastest')
    tony.setpos(80, -15)
    tony.pencolor('green')
    tony.goto(0, -200)
    tony.fillcolor('purple')
    tony.goto(80,-15)
    tony.rt(40)
    tony.flowerhead()


def flower3(): …
Run Code Online (Sandbox Code Playgroud)

python simultaneous turtle-graphics

1
推荐指数
1
解决办法
2283
查看次数