switch to row, column

This commit is contained in:
2025-08-22 11:44:22 -05:00
parent 53f58a3133
commit aadd924bd0
10 changed files with 41 additions and 42 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ void print_wires(WireColor* wires, int editing_idx) {
lcd_print(1, 1, string_buf);
cut_to_string(cut, string_buf);
lcd_print(1, 2, string_buf);
lcd_print(2, 1, string_buf);
wires_state = get_wires();
for (int i = 0; i < NUM_WIRES; i++) {
@@ -21,7 +21,7 @@ void print_wires(WireColor* wires, int editing_idx) {
string_buf[i] = '!';
}
}
lcd_print(1, 3, string_buf);
lcd_print(3, 1, string_buf);
// TODO: find a way to indicate without a cursor.
// lcd_set_cursor_pos(editing_idx+1, 1);
+8 -8
View File
@@ -336,32 +336,32 @@ static void debug_switches() {
while (1) {
if (get_button_pressed(&button)) {
sprintf(buf, "Button Pressed: %d ", button);
lcd_print(0, 3, buf);
lcd_print(3, 0, buf);
ESP_LOGI(TAG, "%s", buf);
}
if (get_button_released(&button)) {
sprintf(buf, "Button Released: %d", button);
lcd_print(0, 3, buf);
lcd_print(3, 0, buf);
ESP_LOGI(TAG, "%s", buf);
}
if (get_switch_flipped_down(&switch_)) {
sprintf(buf, "Switch Down: %d ", switch_);
lcd_print(0, 3, buf);
lcd_print(3, 0, buf);
ESP_LOGI(TAG, "%s", buf);
}
if (get_switch_flipped_up(&switch_)) {
sprintf(buf, "Switch Up: %d ", switch_);
lcd_print(0, 3, buf);
lcd_print(3, 0, buf);
ESP_LOGI(TAG, "%s", buf);
}
if (get_switch_touch_pressed(&switch_)) {
sprintf(buf, "Switch Touch: %d ", switch_);
lcd_print(0, 3, buf);
lcd_print(3, 0, buf);
ESP_LOGI(TAG, "%s", buf);
}
if (get_switch_touch_released(&switch_)) {
sprintf(buf, "Switch Un-touch: %d", switch_);
lcd_print(0, 3, buf);
lcd_print(3, 0, buf);
ESP_LOGI(TAG, "%s", buf);
}
@@ -370,7 +370,7 @@ static void debug_switches() {
switch_touch_state = new_switch_touch_state;
print_4bin_rev(bin_buf, switch_touch_state);
sprintf(buf, "t: %s", bin_buf);
lcd_print(1, 0, buf);
lcd_print(0, 1, buf);
ESP_LOGI(TAG, "%s", buf);
}
@@ -388,7 +388,7 @@ static void debug_switches() {
button_state = new_button_state;
print_4bin_rev(bin_buf, button_state);
sprintf(buf, "b: %s", bin_buf);
lcd_print(1, 2, buf);
lcd_print(2, 1, buf);
ESP_LOGI(TAG, "%s", buf);
}
+1 -1
View File
@@ -199,7 +199,7 @@ static int generate_part(void) {
static void update_lcd_count(int times) {
char buf[16] = {0};
sprintf(buf, "%d/15", times);
lcd_print(14, 1, buf);
lcd_print(1, 14, buf);
}
static bool play_part(uint32_t time) {
+6 -6
View File
@@ -729,7 +729,7 @@ void step5(void) {
}
// display expression
lcd_print(1, 2, display_expression.c_str());
lcd_print(2, 1, display_expression.c_str());
// set LEDs
const uint32_t COLORS[] = {
@@ -790,8 +790,8 @@ void step5(void) {
lcd_clear();
lcd_print(1, 1, "What");
lcd_print(1, 2, display_expression.c_str());
lcd_print(1, 3, entered_string.c_str());
lcd_print(2, 1, display_expression.c_str());
lcd_print(3, 1, entered_string.c_str());
}
if (get_module_time() <= 0) {
strike("Ran out of time!");
@@ -849,7 +849,7 @@ void step5(void) {
// ESP_LOGI(TAG, "color string: %s", color_string.c_str());
lcd_print(1, 2, color_string.c_str());
lcd_print(2, 1, color_string.c_str());
std::string entered_string;
@@ -880,8 +880,8 @@ void step5(void) {
lcd_clear();
lcd_print(1, 1, "Plink");
lcd_print(1, 2, color_string.c_str());
lcd_print(1, 3, entered_string.c_str());
lcd_print(2, 1, color_string.c_str());
lcd_print(3, 1, entered_string.c_str());
}
if (get_module_time() <= 0) {
strike("Ran out of time!");