diff --git a/run.py b/run.py index a295a95..5792c32 100644 --- a/run.py +++ b/run.py @@ -147,13 +147,20 @@ def read_di(io_num=None): @app.route('/api/' + api_ver + '/read/' + ui + '/', methods=['GET']) def read_ai(io_num=None): gpio = analog_in(io_num) + print("gpio", gpio) min_range = ui_calibration_table(io_num)[0] max_range = ui_calibration_table(io_num)[1] + print("min_range", min_range) + print("max_range", max_range) if gpio == -1: return jsonify({'1_state': "unknownType", '2_ioNum': io_num, '3_gpio': gpio, '4_val': 'null', "5_msg": analogInTypes}), http_error else: + print("ADC", ADC) + print("ADC.read(gpio)", ADC.read(gpio)) + print("Check...") val = ui_scale(io_num, ADC.read(gpio)) # !!! GPIO CALL !!! + print("val", val) # val = fake_analogue_data() # !!! FOR TESTING !!! return jsonify({'1_state': "readOk", '2_ioNum': io_num, '3_gpio': gpio, '4_val': val, '5_msg': 'read value ok', '6_min_range': min_range, '7_max_range': max_range}), http_success