Last active
December 16, 2015 13:39
-
-
Save Mikulas/5443646 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GPoint getCenter(int row, int led) { | |
return GPoint(12 + led * 24, 70 + 27 * row); | |
} | |
void color_led(GContext* ctx, int row, int led, bool on) { | |
graphics_context_set_fill_color(ctx, on ? GColorWhite : GColorBlack); | |
graphics_fill_circle(ctx, getCenter(row, led), CIRCLE_RADIUS); | |
} | |
// ############### for PCB binary | |
GRect getRect(int row, int led) { | |
if (row === 0) | |
return GRect(12 + led * 40, 50, 30 + led * 40 + 20, 50 + 20); | |
else | |
return GRect(12 + led * 20, 100, 30 + led * 20 + 20, 100 + 20); | |
} | |
void color_led(GContext* ctx, int row, int led, bool on) { | |
graphics_context_set_fill_color(ctx, on ? GColorWhite : GColorBlack); | |
graphics_fill_rect(ctx, getRect(row, led), 1, null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment