Joystick input not read in serial port

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello, 

   

I am working on a project and my team is trying to read a joystick input into a serial port.  Right now I am trying to convert the joystick game controller code to meet my needs.

   

A second question we have regards BLE versus standard Bluetooth.  Is it possible to use regular Bluetooth to connect to the PSoC?

   

Please let me know how this could be accomplished.  

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the forum!

   

The expression

   

    X_Axis = SAR_ADC_GetResult16(0) *0xFF /0x7FF;                        /* Get ADC reading and store in variable X_Axis */

   

might not give the expected result due to overflow and intterpretation of 0xFF a positive or negative number. Write 0xFFu for unsigned.

   

You did not tell what errors you have got.

   

 

   

BLE is not compatible to "normal" Bluetooth.

   

 

   

Bob

View solution in original post

0 Likes
2 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the forum!

   

The expression

   

    X_Axis = SAR_ADC_GetResult16(0) *0xFF /0x7FF;                        /* Get ADC reading and store in variable X_Axis */

   

might not give the expected result due to overflow and intterpretation of 0xFF a positive or negative number. Write 0xFFu for unsigned.

   

You did not tell what errors you have got.

   

 

   

BLE is not compatible to "normal" Bluetooth.

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Here is a program that moves the time around the screen.  I think you can get an ideal about the Joystick from this program.  It will need to be up graded to the latest component revisions however.

0 Likes