Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
use a ADC_IN[n] to read Analog of PC Joystick
#1
Hi,

i modify a PC Joystick to move my omnidirecctional machine, but i don´t can read the value of analog control. I load the configuration that appears in the Power Clipper Manual, but the variable ADC_In have a static value of -1.

Sys.WpKey = $AAAAAAAA; // Disable Write-Protection
Clipper[0].Chan[0].PackInData = 0; // Unpack Input Data all ADCs J3, J7
PTR ADCIN_1->S.IO:$900030.20.12; // ADCIN_1 J3 [bits]
PTR ADCIN_2->S.IO:$900034.20.12; // ADCIN_2 J3 [bits]
PTR ADCIN_3->S.IO:$900038.20.12; // ADCIN_3 J7 [bits]
PTR ADCIN_4->S.IO:$90003C.20.12; // ADCIN_4 J7 [bits]

pag. 34 of Power Clipper User Manual.

the feedback of servo is by the enconders channel inputs and work fine.

i try the other configuration that appears but without a good response.

ADC1VoltsIn = ((Clipper[0].Chan[0].AdcEnc[0] >> 20) * 10 / 2048) - ADC1ZeroOffset ;
ADC2VoltsIn = ((Clipper[0].Chan[0].AdcEnc[1] >> 20) * 10 / 2048) – ADC2ZeroOffset ;
ADC3VoltsIn = ((Clipper[0].Chan[0].AdcEnc[2] >> 20) * 10 / 2048) – ADC3ZeroOffset ;
ADC4VoltsIn = ((Clipper[0].Chan[0].AdcEnc[3] >> 20) * 10 / 2048) – ADC4ZeroOffset ;

i need modify some other variable to enable the ADC_In?

Thanks
Reply
#2
Can you directly read the ADC raw register at: Clipper[0].Chan[0].AdcEnc[i], i=0,1,2,3?

Verify that you have the ADC option.
Reply
#3
(03-22-2018, 03:49 PM)steve.milici Wrote: Can you directly read the ADC raw register at: Clipper[0].Chan[0].AdcEnc[i], i=0,1,2,3?

Verify that you have the ADC option.

thanks Steve, i don´t have the option unfortunately.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)