Skip to content
This repository was archived by the owner on Sep 30, 2019. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,356 changes: 678 additions & 678 deletions Adafruit_ADS1x15/Adafruit_ADS1x15.py

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions Adafruit_ADS1x15/ads1x15_ex_comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
from Adafruit_ADS1x15 import ADS1x15

def signal_handler(signal, frame):
print 'You pressed Ctrl+C!'
print adc.getLastConversionResults()/1000.0
adc.stopContinuousConversion()
sys.exit(0)
print 'You pressed Ctrl+C!'
print adc.getLastConversionResults()/1000.0
adc.stopContinuousConversion()
sys.exit(0)

signal.signal(signal.SIGINT, signal_handler)
# Print 'Press Ctrl+C to exit'

ADS1015 = 0x00 # 12-bit ADC
ADS1115 = 0x01 # 16-bit ADC
ADS1015 = 0x00 # 12-bit ADC
ADS1115 = 0x01 # 16-bit ADC

# Initialise the ADC using the default mode (use default I2C address)
# Set this to ADS1015 or ADS1115 depending on the ADC you are using!
Expand All @@ -24,7 +24,7 @@ def signal_handler(signal, frame):
adc.startSingleEndedComparator(2, 200, 100, pga=1024, sps=250, activeLow=True, traditionalMode=True, latching=False, numReadings=1)

while True:
print adc.getLastConversionResults()/1000.0
time.sleep(0.25)
print adc.getLastConversionResults()/1000.0
time.sleep(0.25)

#time.sleep(0.1)
5 changes: 3 additions & 2 deletions Adafruit_ADS1x15/ads1x15_ex_differential.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
from Adafruit_ADS1x15 import ADS1x15

def signal_handler(signal, frame):
#print 'You pressed Ctrl+C!'
sys.exit(0)
#print 'You pressed Ctrl+C!'
sys.exit(0)

signal.signal(signal.SIGINT, signal_handler)
#print 'Press Ctrl+C to exit'

Expand Down
5 changes: 3 additions & 2 deletions Adafruit_ADS1x15/ads1x15_ex_singleended.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
from Adafruit_ADS1x15 import ADS1x15

def signal_handler(signal, frame):
print 'You pressed Ctrl+C!'
sys.exit(0)
print 'You pressed Ctrl+C!'
sys.exit(0)

signal.signal(signal.SIGINT, signal_handler)
#print 'Press Ctrl+C to exit'

Expand Down
Loading