Feb-07-2017, 05:03 PM
Hello, I am typing this from a cellphone so please bear with me. But my issue here is I am trying to read an ADC voltage value using an ADS1x15 ADC converter and then store the values as a variable in order to plug that value into an equation. An example script can be seen below:
ADC_Value = adc.read_adc_difference(0, gain=GAIN)
x_Input = (ADC_Value - 68)*(3/24432)
print(ADC_Value)
print(x_Input)
I am unsure as to what Im missing. I do not get any syntax errors only a value of 0 for my x_Input variable every time it prints. I am working on making a PLC to control an industrial fan and this is my first exposure to programming so please have mercy.
Thank you,
The Hopeful Noob
ADC_Value = adc.read_adc_difference(0, gain=GAIN)
x_Input = (ADC_Value - 68)*(3/24432)
print(ADC_Value)
print(x_Input)
I am unsure as to what Im missing. I do not get any syntax errors only a value of 0 for my x_Input variable every time it prints. I am working on making a PLC to control an industrial fan and this is my first exposure to programming so please have mercy.
Thank you,
The Hopeful Noob