Open SmallpTsai opened 5 years ago
Sample code
class Label : public LRemoteLabel { public: Label(const String &text, uint8_t x, uint8_t y, uint8_t w, uint8_t h, RCColorType color = RC_GREY) : LRemoteLabel() { setText(text); setPos(x, y); setSize(w, h); setColor(color); } };
Usage example
Label label1("Select leg", L_X(0), L_Y(0), L_W, L_H);
Much cleaner code
static Label label1("Select leg", L_X(0), L_Y(0), L_W, L_H); static Label text1("", T_X(0), T_Y(0), T_W, T_H, RC_PINK); static Button button1l(10, "<", Bl_X(0), Bl_Y(0), B_W, B_H, RC_BLUE); static Button button1r(11, ">", Br_X(0), Br_Y(0), B_W, B_H, RC_BLUE); ... setup() { ... LRemote_addControls({ &label1, &text1, &button1l, &button1r, // row1 ... }); ... }
reference: https://github.com/SmallpTsai/hexapod-v2-7697/blob/master/software/hexapod7697/src/setting_mode.cpp
Sample code
Usage example
Much cleaner code
reference: https://github.com/SmallpTsai/hexapod-v2-7697/blob/master/software/hexapod7697/src/setting_mode.cpp