Git Product home page Git Product logo

Comments (6)

martinohanlon avatar martinohanlon commented on June 28, 2024

Can you provide your script please.

from bluedot.

erikvanelten avatar erikvanelten commented on June 28, 2024

It's the first sample script from the recipes ( http://bluedot.readthedocs.io/en/latest/recipes.html#mock-app )

from bluedot import MockBlueDot

def say_hello():
print("Hello World")

bd = MockBlueDot()
bd.when_pressed = say_hello

bd.launch_mock_app()

from bluedot.

martinohanlon avatar martinohanlon commented on June 28, 2024

I see the problem.

I tested running from IDLE which keeps the application alive. If you run from the command prompt as soon as the mock app has finished launching the program ends which simulates the client disconnecting.

If you want to run it via the command prompt you will need to use pause() to keep your program alive.

from bluedot import MockBlueDot
from signal import pause

def say_hello():
    print("Hello World")

bd = MockBlueDot()
bd.when_pressed = say_hello

bd.launch_mock_app()

pause()

Ill update the docs.

Also as an aside, I would recommend running your programs using python 3, i.e.

python3 m.py

rather than:

python m.py

which runs as python 2.

from bluedot.

erikvanelten avatar erikvanelten commented on June 28, 2024

Fantastic! Works like a charm now! Great stuff, this. I really like it a lot, so much potential.

and btw: sorry for the strange font size above, I think I accidentally touched a button....

from bluedot.

erikvanelten avatar erikvanelten commented on June 28, 2024

Off-topic, but I think you'd like to know this. I installed everything (IDLE on Python3, Pygame, BlueDot etc.) on my laptop (Intel i5, 6 GB running Linux Mint) and the Mock App runs well, but takes almost 98% CPU... My laptop overheated and shut down.

?

from bluedot.

martinohanlon avatar martinohanlon commented on June 28, 2024

Interesting. pygame must be doing something different with events. The Pi seems to wait until events occur rather than looping.

I have updated the mock blue app (v 0.1.2) to implement a clock, hopefully that will make a difference, its a better implementation.

I have also updated the docs re the original issue.

from bluedot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.