From e4a20934601f720c0edea6011acc5ac3d1ef4f7a Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 21 Jan 2025 10:58:43 +0800 Subject: [PATCH] fix TEC current scale --- kirdy.cpp | 4 ++-- kirdy.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kirdy.cpp b/kirdy.cpp index 52a9f6b..02c9028 100644 --- a/kirdy.cpp +++ b/kirdy.cpp @@ -37,10 +37,10 @@ float Kirdy::get_laser_temp() return reply["thermostat"]["temperature"].asFloat(); } -void Kirdy::set_tec_current(float amps) +void Kirdy::set_tec_current(float milliamps) { Json::Value request; - request["tec_set_i"] = amps; + request["tec_set_i"] = milliamps*0.001f; Json::Value reply = command(request); if(reply["msg_type"].asString() != "Acknowledge") std::cerr << "TEC set current failed\n"; diff --git a/kirdy.hpp b/kirdy.hpp index 8d83305..9640a9b 100644 --- a/kirdy.hpp +++ b/kirdy.hpp @@ -10,5 +10,5 @@ class Kirdy { public: Kirdy(asio::string_view host, asio::string_view service); float get_laser_temp(); - void set_tec_current(float amps); + void set_tec_current(float milliamps); };