Support and General Use > Plugins/Viewers

External Input for LUA

(1/1)

LoneWolf_Recon:
Hey guys,

  Sorry for two threads in the same section but this one is pretty deep. What I'm planning is making my Fuze as a microcomputer for a few possible robots and "embedded systems" projects in the future. All the internal processing I can do in LUA. But I'm just tossing ideas around for possible external input/output besides the buttons and the LCD.

I've read one thread that USB communications isn't fully implemented(Besides the USB HID), so could the HID Header work for USB I/O? I've seen a few functions in the file that look like get/send HID commands..

But if that's not possible I can do audio signals for I/O. Like Mic for input, Headphone jack for output and encoding the data as audio signals. The audio out I've worked, but is there a file for getting Mic input and/or determining frequencies coming in through the Mic?

Thanks again guys(I'm done talking  :D)
,LoneWolf

saratoga:

--- Quote from: LoneWolf_Recon on July 08, 2011, 10:57:34 PM ---I've read one thread that USB communications isn't fully implemented(Besides the USB HID), so could the HID Header work for USB I/O? I've seen a few functions in the file that look like get/send HID commands..
--- End quote ---

Assuming you have the FuzeV2, we don't even have a fully working USB driver.


--- Quote from: LoneWolf_Recon on July 08, 2011, 10:57:34 PM ---But if that's not possible I can do audio signals for I/O. Like Mic for input, Headphone jack for output and encoding the data as audio signals. The audio out I've worked, but is there a file for getting Mic input and/or determining frequencies coming in through the Mic?


--- End quote ---


Have you looked at plugin.h?  It exposes all the API functions for plugins (of course you can add more if you need them...):


--- Code: ---#ifdef HAVE_RECORDING
    const unsigned long *rec_freq_sampr;
    void (*pcm_init_recording)(void);
    void (*pcm_close_recording)(void);
    void (*pcm_record_data)(pcm_rec_callback_type more_ready,
                            void *start, size_t size);
    void (*pcm_stop_recording)(void);
    void (*pcm_calculate_rec_peaks)(int *left, int *right);
    void (*audio_set_recording_gain)(int left, int right, int type);
#endif /* HAVE_RECORDING */

--- End code ---

LoneWolf_Recon:
Thanks Saratoga  ;D
Post Merge: July 09, 2011, 11:04:08 PMI'm still having problems with the pcmbuf_beep command. I've tried including the pcmbuf file into the main lua program but it wont work. And what is the limits to the beep command on amplitude? Thanks again  :D

LoneWolf_Recon:
Has anyone worked with the pcmbuf_beep command or the other PCM commands? LUA runs the program perfectly except no beep..  :-\

I've tried to directly include the pcmbuf header into the LUA program but no dice...

Navigation

[0] Message Index

Go to full version