Coder Social home page Coder Social logo

Comments (10)

tannewt avatar tannewt commented on July 26, 2024

This works for me except if I have the terminal up the first a is consumed when opening the repl. If I change it to type 5 As then I get:

Adafruit CircuitPython 1.0.0-rc.3-1-g3cd710c8-dirty on 2017-07-03; Adafruit Gemma M0 with samd21e18
>>>
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:

Adafruit CircuitPython 1.0.0-rc.3-1-g3cd710c8-dirty on 2017-07-03; Adafruit Gemma M0 with samd21e18
>>> aaaa

My file is:

from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
import time

kbd = Keyboard()

for i in range(5):
    kbd.press(Keycode.A)
    time.sleep(0.1)
    kbd.release_all()

from adafruit_circuitpython_hid.

dhalbert avatar dhalbert commented on July 26, 2024

What happens if you just run that code manually from the REPL instead of as auto-reload? All the testing I have done is from the REPL.

If you insert a short sleep() before the loop, does the first a appear?

I haven't added sleep() before release_all(). You should be able to omit it.

from adafruit_circuitpython_hid.

tannewt avatar tannewt commented on July 26, 2024

Yes, all five as are in the REPL when the same code is in REPL without the sleep.

from adafruit_circuitpython_hid.

dhalbert avatar dhalbert commented on July 26, 2024

How about with the sleep in the REPL? I am a little confused about whether it's the removal of the sleep or using the REPL that caused the problem to go away. If the sleep is causing the problem maybe it's messing up the USB output in some way.

from adafruit_circuitpython_hid.

tannewt avatar tannewt commented on July 26, 2024

I don't think there is an issue at all. The first a is consumed by the "Press any key to enter the REPL".

from adafruit_circuitpython_hid.

dhalbert avatar dhalbert commented on July 26, 2024

Ah! (slaps own forehead) (replying while on vacation on phone maybe not such a good idea)

from adafruit_circuitpython_hid.

ladyada avatar ladyada commented on July 26, 2024

hiya just to check - scott are you using the old gemma or are you using metro/feather?

from adafruit_circuitpython_hid.

tannewt avatar tannewt commented on July 26, 2024

The old gemma.

from adafruit_circuitpython_hid.

ladyada avatar ladyada commented on July 26, 2024

oh weird...ok maybe its me? ill do more testing tonite

from adafruit_circuitpython_hid.

tannewt avatar tannewt commented on July 26, 2024

Ok, keep me posted!

from adafruit_circuitpython_hid.

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.