Skip to content

Commit 9bc1fa5

Browse files
author
Janne Luijten
committed
Update S4_EMG.ipynb
Made some changes for better sampling frequency
1 parent 883d30f commit 9bc1fa5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

S4_EMG/S4_EMG.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@
114114
"from adafruit_ads1x15.ads1x15 import Mode\n",
115115
"\n",
116116
"# Create the ADC object, for the ADS1115. \n",
117-
"# Set Mode to continuous for higher sampling frequency\n",
118-
"ads = ADS.ADS1115(i2c, mode=Mode.CONTINUOUS)"
117+
"# Set Mode to continuous for higher sampling frequency and specify data_rate\n",
118+
"ads = ADS.ADS1115(i2c, mode=Mode.CONTINUOUS, data_rate=860)"
119119
]
120120
},
121121
{
@@ -187,8 +187,8 @@
187187
"import time\n",
188188
"\n",
189189
"# Create the ADC object, for the ADS1115. \n",
190-
"# Set Mode to continuous for higher sampling frequency\n",
191-
"ads = ADS.ADS1115(i2c, mode=Mode.CONTINUOUS)\n",
190+
"# Set Mode to continuous for higher sampling frequency and specify data_rate\n",
191+
"ads = ADS.ADS1115(i2c, mode=Mode.CONTINUOUS, data_rate=860)\n",
192192
"\n",
193193
"# Print the raw values and the voltage\n",
194194
"while True:\n",
@@ -197,7 +197,7 @@
197197
" chan = AnalogIn(ads, ADS.P0)\n",
198198
" value = chan.value\n",
199199
" voltage = chan.voltage\n",
200-
" time.sleep(0.005)\n",
200+
" time.sleep(0.005) #adjust to alter the speed of the loop\n",
201201
" \n",
202202
" print('\\r\\n Value = %4d , Voltage = %.4f '%(value,voltage))\n",
203203
" \n",

0 commit comments

Comments
 (0)