STM32-X360-xinput icon indicating copy to clipboard operation
STM32-X360-xinput copied to clipboard

adc value

Open hachirokumiku opened this issue 2 years ago • 0 comments

if( adcValueReady == 1 ){
	rightTriggerValue = (uint8_t)map( rightTriggerValue_ADC, 0, 4096, 0, UINT8_MAX );
	leftTriggerValue 	= (uint8_t)map( leftTriggerValue_ADC, 0, 4096, 0, UINT8_MAX );
		
	xRightStickValue = (int16_t)map( xRightStickValue_ADC, 0, 4096, INT16_MIN, INT16_MAX );
	yRightStickValue = (int16_t)map( yRightStickValue_ADC, 0, 4096, INT16_MIN, INT16_MAX );							// 4040 is the max value that my adc presents with potentiometers
	xLeftStickValue = (int16_t)map( xLeftStickValue_ADC, 0, 4096, INT16_MIN, INT16_MAX );
	yLeftStickValue = (int16_t)map( yLeftStickValue_ADC, 0, 4096, INT16_MIN, INT16_MAX );
	
	adcValueReady = 0;
	
	the ADC Value reports as 4096 on my setup, 4040 causes rolls

hachirokumiku avatar Oct 11 '22 10:10 hachirokumiku