Python Forum
Pulling an ADC value and using it
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pulling an ADC value and using it
#1
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
Reply


Messages In This Thread
Pulling an ADC value and using it - by Raudert - Feb-07-2017, 05:03 PM
RE: Pulling an ADC value and using it - by mcmxl22 - Feb-07-2017, 07:00 PM
RE: Pulling an ADC value and using it - by Raudert - Feb-07-2017, 07:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pulling Specifics Words/Numbers from String bigpapa 2 776 May-01-2023, 07:22 PM
Last Post: bigpapa
  Having trouble installing scikit-learn via VSC and pulling my hair out pythonturtle 1 768 Feb-07-2023, 02:23 AM
Last Post: Larz60+
  (Python) Pulling data from UA Google Analytics with more than 100k rows into csv. Stockers 0 1,242 Dec-19-2022, 11:11 PM
Last Post: Stockers
  Pulling username from Tuple pajd 21 3,437 Oct-07-2022, 01:33 PM
Last Post: pajd
  pulling multiple lines from a txt IceJJFish69 3 2,594 Apr-26-2021, 05:56 PM
Last Post: snippsat
  Pulling Information Out of Dictionary Griever 4 2,904 Aug-12-2020, 02:34 PM
Last Post: Griever
  Pulling & Reading Date from UDF that Compare it to Live Data firebird 4 2,801 Jul-20-2019, 09:30 AM
Last Post: snippsat
  Pulling data from Sharepoint list gandiswapna0388 1 2,627 Jul-17-2019, 08:35 AM
Last Post: perfringo
  Need help pulling bios serial # or mac Ad cibb 2 2,908 Mar-16-2018, 01:59 PM
Last Post: cibb
  String Pulling pdatt794 1 2,767 Oct-23-2017, 08:18 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020