/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / JOYSTICK PIN

Username:     
Password:     
             

Forum

# 1   2010-03-02 20:17:42 JOYSTICK PIN

plmuthu25
New member
Registered: 2010-02-18
Posts: 7

JOYSTICK PIN

SUB : JOYSTICK IS CONNECT TO WHICH PORT PIN ?

AM DOING A PROGRAM , IN WHICH FOR EVERY ARROW KEY I PRESS CERTAIN ACTION HAS TO TAKE PLACE

EXAMPLE :

IF I PRESS "UP" ARROW KEY , I NEED TO DISPLAY ''0"
IF I PRESS "DOWN" ARROW KEY , I NEED TO DISPLAY ''1"
IF I PRESS "LEFT" ARROW KEY , I NEED TO DISPLAY ''2"
IF I PRESS "RIGHT" ARROW KEY , I NEED TO DISPLAY ''3"

PLZ REPLY ME AS SOON AS POSSIBLE ... THANK U

Offline

 

# 2   2010-03-02 23:41:23 JOYSTICK PIN

plmuthu25
New member
Registered: 2010-02-18
Posts: 7

Re: JOYSTICK PIN

i got the ANSWER for the above one ... now i have  another query ?

query : i need to add audio to my program

example :
         IF I PRESS "UP" ARROW KEY , I NEED TO GET A VOICE  ''YOU ARE IN GROUND FLOOR"
         IF I PRESS "DOWN" ARROW KEY , I NEED TO DISPLAY ''YOU ARE IN 1ST FLOOR"
         IF I PRESS "LEFT" ARROW KEY , I NEED TO DISPLAY ''YOU ARE IN 2ND FLOOR"
         IF I PRESS "RIGHT" ARROW KEY , I NEED TO DISPLAY ''YOU ARE IN 3RD FLOOR"


PLZ REPLY ME AS SOON AS POSSIBLE ...... THANKS IN ADVANCE

Offline

 

# 3   2010-03-03 09:47:01 JOYSTICK PIN

yrt
Administrator
From: Grenoble-France
Registered: 2008-06-11
Posts: 520
Website

Re: JOYSTICK PIN

Hi,

For the first question the answer is the use of the Circle API "JOYSTICK_GetState", which gives you the direction of the joystick (see the enum JOYSTICK_state definition in circle_api.h).

For the second question :
1 : record your audio messages with the Windows recorder or a better audio software, into ".wav" files,
2 : suppressed the wav header of the files (44 bytes), to keep only the raw data,
3 : convert files to ".h" files thanks to "bin2hex" and "hex2bin" tools provided with Ride,
4 : insert the ".h" into your code,
5 : call the Circle API "AUDIO_SetMode" according to your audio file format,
6 : call the Circle API "AUDIO_Play".

You can take a look to how the welcome message is managed in Circle OS, with "AUDIO_Welcome_Msg()" function in the "audio.c" file).

Yves

Offline

 

# 4   2010-03-03 11:06:58 JOYSTICK PIN

plmuthu25
New member
Registered: 2010-02-18
Posts: 7

Re: JOYSTICK PIN

thanks Yves , am going to try it ......

Offline

 

Board footer