-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add commands for sound effects (siren, horn) #1
Comments
Hello, sorry for the delay. We understand this could make programming the train more fun, so here are some instructions how to use sounds (before we release it) with the low-level # horn 1
await train.send_command(0x24, [0x00, 0x16, 0x80, 0x00, 0x00])
await asyncio.sleep(2)
# bell
await train.send_command(0x24, [0x00, 0x17, 0x00, 0x00, 0x00])
await asyncio.sleep(2)
# horn 2
await train.send_command(0x24, [0x00, 0x17, 0x80, 0x00, 0x00])
await asyncio.sleep(2)
# police horn
await train.send_command(0x24, [0x00, 0x18, 0x00, 0x00, 0x00])
await asyncio.sleep(2)
# alarm
await train.send_command(0x24, [0x00, 0x18, 0x80, 0x00, 0x00])
await asyncio.sleep(2) Since the sound is played back from the train without any feedback, the application needs to wait (some time) for the playback to finish. Without this wait the playback would be interrupted and only the last one would play. Note: since you want to send raw bytes (and not use the library), don't forget to add the length byte (5) after the command byte (24h), e.g. |
Great. Thank you! |
(actually I shouldn't close it) BTW: Are there other commands not implemented by the library yet? For example sound volume? |
Unfortunately the FW doesn't support setting volume yet. The purpose of the library is not to implement all possible commands, but to provide a clean and stable API to interact with the train. If you would like to program something that our library doesn't support, please let us know. |
I don't know everything what is possible ;-). BTW I've already implemented playing sound in nodejs library. |
@zdila lol - nice ... slightly joking but I wonder if we could run node lambda functions in AWS with somehow a local bridge to BLE :) btw is FW update possible via app I assume? |
@guoruicodes for FW update use Android app :-) |
@zdila apologies for cluttering this thread but it looks like AWS IOT blogs are using mobile apps as the bluetooth bridge to the device (arduinos in the blogs) - which makes a lot of sense. @petrusek putting support for this on your app backlog would be super - even in a 12-18 month timeline. If we have a cloud connection - then its "my train moves quicker when sentiment analysis about the local weather is good" .... |
@guoruicodes - sounds great... also you've guessed the timeline pretty well 😂 |
Hello,
Android application has buttons for sending various sound effects (horn, siren, ...). Please add sound effect commands also to the library or at least tell me what byte sequence should I send to characterstic
40c540d0-344c-4d0d-a1da-9cc260b82d43
. I would like to implement it to https://github.com/zdila/node-intelino.Thanks!
The text was updated successfully, but these errors were encountered: