Forum
× Suggestions
This is the optional category header for the Suggestion Box.

More examples!

More
#560 by ericleven
ericleven created the topic: More examples!
I'm coming from an Arduino background, with its large user base, help books, etc. So far, the EZ scripting system has been a little confusing for me, especially since the only information I have about how to use it is on this site.

More example programs would be super helpful; for example, I'd like to modify the talking_book.EZ so that instead of using forward and back buttons, it uses a series of photo-resistors to indicate which audio file to play (as you open a specific page, light hits the photo-resistor and the book plays the audio for that page). But I have no idea how to do this.

Also, didn't I read that the Foxonix board can trigger an output based on an audio file? I'd like to play a 3 second audio file, and at one second turn on an LED, and at two seconds turn a motor, etc.

Thanks!

-eric

Please Log in or Create an account to join the conversation.

More
#563 by foxonix
foxonix replied the topic: More examples!
Hi Eric:

We completely agree that we need more example programs. Right now there are a handful on the Sample Programs page and (as you already know) a couple of projects up on Instructables .

Any type of input device can be used to trigger an input pin - it doesn't have to be a button or a switch. It could be a motion sensor, light sensor, or another microcontroller (like an Arduino). The input pin is really just looking for an edge transition, so if you have a photo resistor circuit that puts out a digital signal you should be able to use that in place of a button. If you want to read multiple inputs there is a snippet of code on the forum that explains how to do that. This allows you to read an entire port and then jump to a place in the program depending on what the inputs are. In the case of modifying the talking book idea, you would read the port and then jump to page1, page2, etc.

Yes, you did indeed read that you can trigger events directly from audio files. Basically, you can insert markers in the audio and use these markers to trigger external events, like controlling a motor or LEDs, or to trigger internal events like jumping to another place in the program. We'll put together a sample program showing how to do this and get it posted for you in the next couple of days. Another option is to cut up your audio file into smaller pieces. Then you could play part1, turn on the LED, play part2, turn on the motor, and so on. This executes quickly enough in the program so that you don't hear the edits in the audio. Both approaches work well, and the approach you use depend on what your needs are in the program.

Thanks for the awesome feedback and questions, and we appreciate that you're experimenting with Foxonix and seeing what it can do. We'll help you as much as we can to get your projects up and running.

Foxonix - make your ideas heard.
@foxonixdev

Please Log in or Create an account to join the conversation.

More
#566 by foxonix
foxonix replied the topic: More examples!
Hello Eric:

We've attached a sample program that uses markers embedded in an audio file that are used to trigger events in the program. In this example, we're turning on LEDs in time with the music, but you could use it control other aspects of the program, like setting registers, jumping to other parts of the program, etc. For the first pass through the song, the event function is enabled in the program (eflag=1), so the markers in the audio will control the LEDs. For the second pass through the song, the event function is disabled (eflag=0), so the markers are ignored. This demonstrates that the event marker function can be turned on and off in the program as needed.

The markers were added to the audio file using Adobe Audition, which is very easy and straightforward. Simply click the audio waveform where you want your marker and then press "m". The name of the marker must be changed so that it is e1, e2, e3, etc. (up to a maximum of e15). See the attached image. When you save the audio file, the markers are embedded as part of the file.

We've noticed that if an audio file with embedded markers is opened with a different audio program (like Audacity) the marker information is lost (not imported). Furthermore, Audacity does not have the ability to export its own marker data as part of the audio. We're pointing this out because the ease of use of the event marker function may depend on what audio editor you're using. If you let us know which one you're using then maybe we can give you more help if you need it. If you're using Adobe Audition you should be all set.

This program will be included as part of a larger update that we're planning soon, which will also included an expanded Programming Reference section with more commands. For now, we wanted to get this example to you so that you could check it out.

Foxonix - make your ideas heard.
@foxonixdev
Attachments:
The following user(s) said Thank You: ericleven

Please Log in or Create an account to join the conversation.

Time to create page: 0.024 seconds