(Apr-24-2020, 02:58 AM)buran Wrote: Why not use an IDE with debugging?What is a good IDE w/debugging to use in 2.7?
I am using the pdb and can't get breakoiint to work:
python -m pdb /usr/local/lib/python2.7/dist-packages/examples/simpletest.py (Pdb) b Adafruit_ADS1x15/ADS1x15.py:134 Response: Breakpoint 1 at /usr/local/lib/python2.7/dist-packages/Adafruit_ADS1x15/ADS1x15.py:134 (Pdb) run Restarting /usr/local/lib/python2.7/dist-packages/examples/simpletest.py with arguments: (Pdb) commands 1 (com) print result[1] (com) end (Pdb) rDoes not stop at breakpoint
postmortom:
(Pdb) c
Reading ADS1x15 values, press Ctrl-C to quit...
| 0 | 1 | 2 | 3 |
-------------------------------------
Error:Traceback (most recent call last):
File "/usr/lib/python2.7/pdb.py", line 1314, in main
pdb._runscript(mainpyfile)
File "/usr/lib/python2.7/pdb.py", line 1233, in _runscript
self.run(statement)
File "/usr/lib/python2.7/bdb.py", line 400, in run
exec cmd in globals, locals
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/examples/simpletest.py", line 42, in <module>
values[i] = adc.read_adc(i, gain=GAIN)
File "/usr/local/lib/python2.7/dist-packages/Adafruit_ADS1x15/ADS1x15.py", line 192, in read_adc
return self._read(channel + 0x04, gain, data_rate, ADS1x15_CONFIG_MODE_SINGLE)
File "/usr/local/lib/python2.7/dist-packages/Adafruit_ADS1x15/ADS1x15.py", line 133, in _read
result = self._device.readList(ADS1x15_POINTER_CONVERSION, 2)
File "/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO/I2C.py", line 134, in readList
results = self._bus.read_i2c_block_data(self._address, register, length)
File "/usr/local/lib/python2.7/dist-packages/Adafruit_PureIO/smbus.py", line 216, in read_i2c_block_data
cmdstring[i] = val
TypeError: one character string expected
Uncaught exception. Entering post mortem debugging
Why not stopping on breakpoint and showing value?Thanks