#include "U8glib.h"
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_DEV_0 | U8G_I2C_OPT_NO_ACK | U8G_I2C_OPT_FAST); // Fast I2C / TWI
// 'project menus 2', 128x64px
const unsigned char epd_bitmap_project_menus_2 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x01, 0xd0, 0x01, 0xc0, 0x40, 0x00, 0xe0, 0x02, 0x10, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x60, 0x82, 0x20, 0xc0, 0x01, 0x10, 0x00, 0x10, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x02,
0x04, 0x31, 0x00, 0x21, 0x48, 0x81, 0x01, 0xc2, 0x10, 0x04, 0x1c, 0x38, 0xf0, 0x00, 0x00, 0x00,
0x08, 0x1a, 0x00, 0x42, 0x48, 0x81, 0x02, 0x22, 0x10, 0x04, 0x22, 0x44, 0x40, 0x00, 0x00, 0x02,
0x08, 0x0c, 0x00, 0x84, 0x48, 0x81, 0x02, 0x22, 0x10, 0x04, 0x22, 0x40, 0x40, 0x00, 0x00, 0x00,
0x08, 0x06, 0x01, 0x07, 0xc8, 0x81, 0x02, 0x22, 0x10, 0x04, 0x3e, 0x38, 0x40, 0x00, 0x00, 0x02,
0x04, 0x03, 0x02, 0x00, 0x48, 0x81, 0x02, 0x22, 0x10, 0x04, 0x20, 0x04, 0x40, 0x00, 0x00, 0x00,
0x02, 0x02, 0x02, 0x00, 0x45, 0x01, 0x12, 0x22, 0x10, 0x04, 0x22, 0x44, 0x40, 0x00, 0x00, 0x02,
0x03, 0x04, 0x03, 0xe0, 0x42, 0x00, 0xe1, 0xc2, 0x08, 0x04, 0x1c, 0x38, 0x30, 0x00, 0x00, 0x00,
0x04, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x87,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27,
0x90, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37,
0x90, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37,
0x90, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x90, 0x04, 0x03, 0xc4, 0x12, 0x08, 0x10, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32,
0x90, 0x04, 0x02, 0x24, 0x12, 0x08, 0x10, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x90, 0x08, 0x02, 0x24, 0x93, 0x18, 0x18, 0xc7, 0x0f, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32,
0x9f, 0xff, 0xc2, 0x24, 0x92, 0xa8, 0x15, 0x48, 0x91, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x98, 0x08, 0x03, 0xc4, 0x92, 0x48, 0x12, 0x48, 0x91, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32,
0x94, 0x10, 0x02, 0x04, 0x92, 0x08, 0x10, 0x48, 0x91, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x94, 0x10, 0x02, 0x04, 0x92, 0x08, 0x10, 0x48, 0x91, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32,
0x92, 0x20, 0x02, 0x04, 0x92, 0x08, 0x10, 0x48, 0x91, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x92, 0x20, 0x02, 0x03, 0x62, 0x08, 0x10, 0x47, 0x0f, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32,
0x91, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x90, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62,
0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0,
0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x82,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x20, 0x0e, 0x1c, 0x41, 0x00, 0x04, 0x10, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,
0x18, 0xc0, 0x00, 0x60, 0x11, 0x22, 0x41, 0x00, 0x04, 0x10, 0x00, 0x40, 0x00, 0x00, 0x00, 0x02,
0x15, 0x40, 0x00, 0xa0, 0x01, 0x22, 0x63, 0x1c, 0x06, 0x31, 0xc3, 0xc7, 0x00, 0x00, 0x00, 0x00,
0x12, 0x40, 0x01, 0x20, 0x02, 0x26, 0x55, 0x22, 0x05, 0x52, 0x24, 0x48, 0x80, 0x00, 0x00, 0x02,
0x10, 0x40, 0x02, 0x27, 0x84, 0x2a, 0x49, 0x02, 0x04, 0x92, 0x24, 0x48, 0x80, 0x00, 0x00, 0x00,
0x10, 0x4c, 0x03, 0xe0, 0x08, 0x32, 0x41, 0x1e, 0x04, 0x12, 0x24, 0x4f, 0x80, 0x00, 0x00, 0x02,
0x10, 0x52, 0x00, 0x20, 0x10, 0x22, 0x41, 0x22, 0x04, 0x12, 0x24, 0x48, 0x00, 0x00, 0x00, 0x00,
0x10, 0x42, 0x00, 0x20, 0x10, 0x22, 0x41, 0x22, 0x04, 0x12, 0x24, 0x48, 0x80, 0x00, 0x00, 0x02,
0x10, 0x4e, 0x00, 0x20, 0x1f, 0x1c, 0x41, 0x1e, 0x04, 0x11, 0xc3, 0xc7, 0x00, 0x00, 0x00, 0x00,
0x10, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x10, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x94, 0x00,
0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x14, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1c, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x54, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// 'Bak_icon_arrow', 16x16px
const unsigned char epd_bitmap_Bak_icon_arrow [] PROGMEM = {
0x00, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x1f, 0xc0, 0x3c, 0x20, 0x7f, 0x90, 0x3c, 0x28, 0x1f, 0x94,
0x0c, 0x42, 0x04, 0x2a, 0x00, 0x2a, 0x00, 0x2a, 0x00, 0x2a, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00
};
// 'copy_icon', 16x16px
const unsigned char epd_bitmap_copy_icon [] PROGMEM = {
0x00, 0x00, 0x1f, 0xe0, 0x10, 0x50, 0x10, 0x48, 0x7e, 0x44, 0x45, 0x7c, 0x44, 0x84, 0x44, 0x44,
0x47, 0xc4, 0x40, 0x44, 0x40, 0x44, 0x40, 0x44, 0x40, 0x44, 0x40, 0x7c, 0x7f, 0xc0, 0x00, 0x00
};
// 'cycle_icon', 16x16px
const unsigned char epd_bitmap_cycle_icon [] PROGMEM = {
0x01, 0xc0, 0x07, 0xe0, 0x0f, 0xf8, 0x1e, 0x3c, 0x1c, 0x1c, 0x38, 0x0e, 0xfe, 0x0e, 0x7c, 0x06,
0x38, 0x0e, 0x11, 0x1e, 0x03, 0x3c, 0x07, 0xf8, 0x0f, 0xf0, 0x07, 0xc0, 0x03, 0x00, 0x01, 0x00
};
// 'Icon_24vcoil ', 16x16px
const unsigned char epd_bitmap_Icon_24vcoil_ [] PROGMEM = {
0x00, 0x00, 0x00, 0x10, 0x02, 0x20, 0x07, 0x40, 0x09, 0x82, 0x10, 0xc4, 0x20, 0x68, 0x20, 0x30,
0x20, 0x18, 0x10, 0x0c, 0x08, 0x08, 0x0c, 0x10, 0x12, 0x20, 0x21, 0xc0, 0x40, 0x00, 0x00, 0x00
};
// 'Icon_gauge', 16x16px
const unsigned char epd_bitmap_Icon_gauge [] PROGMEM = {
0x03, 0xc0, 0x1c, 0x38, 0x22, 0xa4, 0x48, 0x02, 0x40, 0x0a, 0xa0, 0x01, 0x90, 0x05, 0xa8, 0x01,
0x84, 0x05, 0xa2, 0x01, 0x81, 0x85, 0x51, 0x82, 0x40, 0x02, 0x20, 0x04, 0x1c, 0x38, 0x03, 0xc0
};
// 'Icon_Ma', 16x16px
const unsigned char epd_bitmap_Icon_Ma [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x00, 0x55, 0x00, 0x49, 0x00, 0x41, 0x00,
0x41, 0x30, 0x41, 0x48, 0x41, 0x08, 0x41, 0x38, 0x41, 0x48, 0x41, 0x48, 0x00, 0x38, 0x00, 0x00
};
// 'Icon_PWM', 16x16px
const unsigned char epd_bitmap_Icon_PWM [] PROGMEM = {
0x00, 0x00, 0x40, 0x06, 0x40, 0x09, 0x40, 0x09, 0x40, 0x10, 0x40, 0x10, 0x40, 0x20, 0x7f, 0xff,
0x60, 0x20, 0x50, 0x40, 0x50, 0x40, 0x48, 0x80, 0x48, 0x80, 0x45, 0x00, 0x42, 0x00, 0x00, 0x00
};
// 'Icon_settings', 16x16px
const unsigned char epd_bitmap_Icon_settings [] PROGMEM = {
0x00, 0x00, 0x01, 0x80, 0x03, 0xc0, 0x07, 0xc0, 0x0f, 0x80, 0x1f, 0x8c, 0x1f, 0xde, 0x1f, 0xfe,
0x1f, 0xfc, 0x1f, 0xf8, 0x1f, 0xf0, 0x3f, 0xe0, 0x7c, 0x00, 0x38, 0x00, 0x10, 0x00, 0x00, 0x00
};
// 'Pulse_icon', 16x16px
const unsigned char epd_bitmap_Pulse_icon [] PROGMEM = {
0x00, 0x00, 0x3c, 0x78, 0x42, 0x84, 0x81, 0x02, 0x80, 0x02, 0x82, 0x02, 0x82, 0x42, 0x45, 0x44,
0x24, 0xb8, 0x18, 0x10, 0x08, 0x20, 0x08, 0x20, 0x04, 0x40, 0x02, 0x80, 0x01, 0x00, 0x00, 0x00
};
// 'sensor_icon', 16x16px
const unsigned char epd_bitmap_sensor_icon [] PROGMEM = {
0x00, 0x00, 0x09, 0x80, 0x02, 0x40, 0x1a, 0x50, 0x02, 0x46, 0x0a, 0x48, 0x02, 0x48, 0x1a, 0x46,
0x02, 0x40, 0x34, 0x20, 0x08, 0x10, 0x2f, 0xf0, 0x0b, 0xd0, 0x25, 0xa0, 0x03, 0xc0, 0x00, 0x00
};
// Array of all bitmaps for convenience. (Total bytes used to store images in PROGMEM = 480)
const unsigned char* Icon_bitmap[10] = {
epd_bitmap_Icon_24vcoil_,
epd_bitmap_Icon_Ma,
epd_bitmap_Icon_PWM,
epd_bitmap_Icon_gauge,
epd_bitmap_Icon_settings,
epd_bitmap_Bak_icon_arrow,
epd_bitmap_Pulse_icon,
epd_bitmap_copy_icon,
epd_bitmap_cycle_icon,
epd_bitmap_sensor_icon
};
// 'Tagg', 8x8px
const unsigned char epd_bitmap_Tagg [] PROGMEM = {
0x00, 0xe5, 0x45, 0x47, 0x55, 0x00, 0xff, 0x00
};
// 'Scroll_bar', 8x64px
const unsigned char epd_bitmap_Scroll_bar [] PROGMEM = {
0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00,
0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00,
0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00,
0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00
};
// 'Highlighted_bar', 128x21px
const unsigned char epd_bitmap_Highlighted_bar [] PROGMEM = {
0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0,
0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80
};
// 'Scroll_handle1', 8x64px
const unsigned char epd_bitmap_Scroll_handle1 [] PROGMEM = {
0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// 'Scroll_handle2', 8x64px
const unsigned char epd_bitmap_Scroll_handle2 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07,
0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// 'Scroll_handle3', 8x64px
const unsigned char epd_bitmap_Scroll_handle3 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// 'Scroll_handle4', 8x64px
const unsigned char epd_bitmap_Scroll_handle4 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// 'Scroll_handle5', 8x64px
const unsigned char epd_bitmap_Scroll_handle5 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// 'Scroll_handle6', 8x64px
const unsigned char epd_bitmap_Scroll_handle6 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07
};
// 'Tomohawk_logo', 128x64px
const unsigned char epd_bitmap_Tomohawk_logo [] PROGMEM = {
0x00, 0x00, 0x00, 0x63, 0xff, 0x27, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0x01, 0xe0, 0x00,
0x00, 0x00, 0x00, 0xc7, 0x83, 0x17, 0xff, 0xff, 0xff, 0xf7, 0xfb, 0xff, 0xff, 0x80, 0xe0, 0x00,
0x00, 0x00, 0x01, 0x83, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xfb, 0xfd, 0xff, 0xff, 0xc0, 0xe0, 0x00,
0x00, 0x00, 0x03, 0x87, 0x06, 0x07, 0xff, 0xff, 0xff, 0xf9, 0xfb, 0xff, 0xff, 0xe0, 0x60, 0x00,
0x00, 0x00, 0x07, 0x3e, 0x06, 0x07, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xfc, 0x03, 0xe0, 0x60, 0x00,
0x00, 0x00, 0x07, 0xc6, 0x0c, 0x1f, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xf0, 0x00, 0x30, 0x70, 0x00,
0x00, 0x00, 0x0c, 0x0c, 0x3c, 0x0f, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xe0, 0x00, 0x00, 0x70, 0x00,
0x00, 0x00, 0x1c, 0x0c, 0x18, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xc0, 0x38, 0x00, 0xf0, 0x00,
0x00, 0x00, 0x18, 0x08, 0x18, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xc0, 0x06, 0x00, 0x70, 0x00,
0x00, 0x00, 0x30, 0x18, 0x18, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xc0, 0x03, 0x80, 0x38, 0x00,
0x00, 0x00, 0x30, 0x30, 0x30, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xc0, 0x7f, 0xe0, 0x18, 0x00,
0x00, 0x00, 0x60, 0xf0, 0x30, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xe1, 0xff, 0xfc, 0x0c, 0x00,
0x00, 0x00, 0x60, 0x70, 0x30, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0x0e, 0x00,
0x00, 0x00, 0xc0, 0x3c, 0x70, 0x1f, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0x0e, 0x00,
0x00, 0x00, 0xc0, 0x70, 0x60, 0x1f, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x8e, 0x00,
0x00, 0x01, 0x80, 0x60, 0x60, 0x5f, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x9f, 0xff, 0xff, 0xfe, 0x00,
0x00, 0x01, 0x80, 0xc0, 0xe0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x9b, 0xff, 0xff, 0xfe, 0x00,
0x00, 0x03, 0x00, 0xc0, 0xe0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x19, 0xff, 0xff, 0xfc, 0x00,
0x00, 0x03, 0x00, 0xc0, 0xc0, 0x3f, 0xff, 0xff, 0xff, 0xfe, 0x3c, 0x0c, 0xff, 0xfe, 0x70, 0x00,
0x00, 0x07, 0x01, 0x80, 0xc0, 0x1f, 0xff, 0xff, 0xff, 0xfc, 0x78, 0x04, 0x3f, 0xfc, 0x30, 0x00,
0x00, 0x06, 0x01, 0x81, 0xc0, 0x1f, 0xff, 0xff, 0xff, 0xfc, 0x78, 0x07, 0x3f, 0xfa, 0x30, 0x00,
0x00, 0x06, 0x01, 0x81, 0xc0, 0x1f, 0xff, 0xff, 0xff, 0xf8, 0xfe, 0x03, 0xff, 0x71, 0x30, 0x00,
0x00, 0x06, 0x07, 0x81, 0x81, 0x3f, 0xff, 0xff, 0xff, 0xf0, 0xfc, 0x00, 0x00, 0x40, 0x18, 0x00,
0x00, 0x0c, 0x07, 0x01, 0x80, 0xbf, 0xff, 0xff, 0xff, 0xf0, 0xf8, 0x00, 0x00, 0x80, 0x08, 0x00,
0x00, 0x0c, 0x03, 0x01, 0x80, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf8, 0x00, 0x00, 0x00, 0x0c, 0x00,
0x00, 0x0c, 0x03, 0xe1, 0x80, 0x7f, 0xff, 0xff, 0xff, 0xf0, 0x78, 0x00, 0x00, 0x00, 0x06, 0x00,
0x00, 0x0c, 0x03, 0xc3, 0xc0, 0x7f, 0xff, 0xff, 0xff, 0xf8, 0x78, 0x00, 0x00, 0x00, 0x06, 0x00,
0x00, 0x1c, 0x03, 0x83, 0xc0, 0x7b, 0xff, 0xff, 0xff, 0xfc, 0x3c, 0x00, 0x00, 0x00, 0x0e, 0x00,
0x00, 0x18, 0x07, 0x03, 0x40, 0x79, 0xff, 0xff, 0xff, 0xfe, 0x3e, 0x00, 0x00, 0x00, 0x1c, 0x00,
0x00, 0x18, 0x06, 0x03, 0x20, 0x78, 0xff, 0xff, 0xff, 0xff, 0x9e, 0x00, 0x00, 0x00, 0x38, 0x00,
0x00, 0x18, 0x06, 0x03, 0x21, 0x78, 0xff, 0xff, 0xff, 0xff, 0x8f, 0x00, 0x00, 0x00, 0x70, 0x00,
0x00, 0x18, 0x0e, 0x03, 0x01, 0xf8, 0xff, 0xff, 0xff, 0x3f, 0xc7, 0x82, 0x7f, 0x80, 0x60, 0x00,
0x00, 0x18, 0x0e, 0x02, 0x00, 0xfc, 0x7f, 0xff, 0xfe, 0x1f, 0xe3, 0x87, 0xff, 0xc0, 0x60, 0x00,
0x00, 0x18, 0x0c, 0x82, 0x00, 0x66, 0x1f, 0xff, 0xfe, 0x0f, 0xf9, 0xff, 0xfe, 0x00, 0x60, 0x00,
0x00, 0x18, 0x1f, 0x02, 0x00, 0xe3, 0x0f, 0xff, 0xfc, 0x03, 0xff, 0xff, 0xec, 0x00, 0x20, 0x00,
0x00, 0x18, 0x1e, 0x02, 0x00, 0xe1, 0xc3, 0xff, 0xfe, 0x01, 0xff, 0xff, 0xcc, 0x00, 0x20, 0x00,
0x00, 0x1d, 0x1e, 0x02, 0x00, 0xe0, 0xe1, 0xff, 0xfe, 0x01, 0xff, 0xfc, 0x98, 0x00, 0x20, 0x00,
0x00, 0x1d, 0x3c, 0x02, 0x00, 0xe0, 0x3f, 0xff, 0xff, 0x19, 0xff, 0xf8, 0x98, 0x00, 0x30, 0x00,
0x00, 0x1d, 0x3c, 0x02, 0x00, 0xc0, 0x0f, 0xff, 0xff, 0x19, 0xff, 0xfd, 0x9c, 0x00, 0x10, 0x00,
0x00, 0x1f, 0xfc, 0x00, 0x00, 0xc0, 0x01, 0xff, 0xff, 0x19, 0xff, 0xf3, 0xfe, 0x64, 0x10, 0x00,
0x00, 0x1f, 0xfc, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x07, 0x9f, 0xff, 0xf1, 0x19, 0x9a, 0xf0, 0x00,
0x00, 0x1f, 0xfc, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x03, 0x9f, 0xff, 0xe1, 0x11, 0x99, 0x30, 0x00,
0x00, 0x1f, 0xec, 0x00, 0x05, 0xc0, 0x00, 0x00, 0x03, 0x9f, 0xff, 0xf9, 0x11, 0x11, 0x30, 0x00,
0x00, 0x1f, 0xec, 0x00, 0x03, 0x80, 0x00, 0x00, 0x03, 0x9f, 0xff, 0xff, 0x99, 0x11, 0x10, 0x00,
0x00, 0x1f, 0xcc, 0x00, 0x03, 0x80, 0x00, 0x00, 0x03, 0x8f, 0xff, 0xf3, 0xf9, 0x91, 0x10, 0x00,
0x00, 0x1f, 0xce, 0x00, 0x01, 0x80, 0x00, 0x00, 0x03, 0x8f, 0xff, 0xf1, 0x3f, 0xff, 0x10, 0x00,
0x00, 0x1f, 0xce, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x8f, 0xfe, 0xf2, 0x11, 0xff, 0xe0, 0x00,
0x00, 0x1f, 0x8e, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x8f, 0xff, 0x7f, 0x10, 0x13, 0x60, 0x00,
0x00, 0x3f, 0x8e, 0x02, 0x01, 0x80, 0x00, 0x00, 0x01, 0x8f, 0xff, 0x7f, 0xf9, 0x12, 0x20, 0x00,
0x00, 0x3f, 0x06, 0x07, 0x21, 0x80, 0x00, 0x00, 0x01, 0xcf, 0xff, 0x3f, 0xff, 0xb6, 0x40, 0x00,
0x00, 0x3a, 0x06, 0x0f, 0x93, 0x00, 0x00, 0x00, 0x01, 0xcf, 0xff, 0x9f, 0xff, 0xff, 0xc0, 0x00,
0x00, 0x30, 0x06, 0x3f, 0xfb, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xff, 0xc3, 0xff, 0xff, 0x80, 0x00,
0x00, 0x60, 0x06, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0xe7, 0xff, 0xe0, 0xff, 0xff, 0x80, 0x00,
0x00, 0x40, 0x02, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0xf3, 0xff, 0xf0, 0x4f, 0xff, 0x80, 0x00,
0x00, 0x00, 0x03, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xfc, 0x00, 0xff, 0x80, 0x00,
0x00, 0x00, 0x03, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xfe, 0x00, 0x27, 0x80, 0x00,
0x00, 0x00, 0x03, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0x00, 0x01, 0x80, 0x00,
0x00, 0x00, 0x03, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xe0, 0x01, 0xc0, 0x00,
0x00, 0x00, 0x03, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, 0x78, 0x00, 0xc0, 0x00,
0x00, 0x00, 0x01, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfe, 0x00, 0x00, 0xc0, 0x00,
0x00, 0x00, 0x01, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xc0, 0x00, 0xc0, 0x00,
0x00, 0x00, 0x01, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x01, 0x80, 0x00,
0x00, 0x00, 0x01, 0xfd, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x87, 0x80, 0x00,
0x00, 0x00, 0x00, 0xfd, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00
};
// Array of all bitmaps for convenience. (Total bytes used to store images in PROGMEM = 480)
const unsigned char* Scroll_handle_bitmap[6] = {
epd_bitmap_Scroll_handle1,
epd_bitmap_Scroll_handle2,
epd_bitmap_Scroll_handle3,
epd_bitmap_Scroll_handle4,
epd_bitmap_Scroll_handle5,
epd_bitmap_Scroll_handle6
};
// 'txt-box24', 64x22px
const unsigned char epd_bitmap_txt_box24 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06,
0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8
};
//number of iteams in menu
#define ROOT_menu_cnt 4
#define SUB1_menu_cnt 5
#define SET24_menu_cnt 10
#define SUB2_menu_cnt 4
#define SUB3_menu_cnt 4
#define SUB4_menu_cnt 4
#define SUB5_menu_cnt 4
//pins outs for buttons
#define BUTTON_SELECT_PIN 4
#define ENC_A 2// Define rotary encoder pins
#define ENC_B 3
//setup emum with all page menu page options
enum pagetype {ROOT_MENU, SUB_MENU1, SETTINGS_24v, SUB_MENU2, SUB_MENU3, SUB_MENU4, SUB_MENU5};
//holds which page is currently selected
enum pagetype currpage = ROOT_MENU;
unsigned long _lastIncReadTime = micros();
unsigned long _lastDecReadTime = micros();
int _pauseLength = 25000;
int _fastIncrement = 10;//increment val for long press encoder
int Selected_Item = 0;//Which is item selected in the menu
uint8_t sub_pos =0;//selected item pos
const int Num_Items = 5;
int Caseval = 0;//item selected from menu int for switch routine
int Previous_Item; // Item before selected one
int Next_Item; // Item after selected one
char menu_items[Num_Items] [10] = {
("24v Coil "),
("4-20ma "),
("PWM "),
("gauge "),
("settings ")
};
void setup() {
pinMode(ENC_A, INPUT_PULLUP);//encoder pinmodes
pinMode(ENC_B, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(ENC_A), read_encoder, CHANGE);
attachInterrupt(digitalPinToInterrupt(ENC_B), read_encoder, CHANGE);
pinMode(BUTTON_SELECT_PIN, INPUT_PULLUP);//select button on encoder
Serial.begin(9600);
u8g.setFont(u8g_font_tpssb);
u8g.setColorIndex(1);
u8g.firstPage();
do{
u8g.drawBitmapP( 1, 1, 128/8, 64, epd_bitmap_Tomohawk_logo); // startup logo
} while ( u8g.nextPage() );
delay (1000);
u8g.firstPage();
do{
u8g.setFont(u8g_font_7x14r);
u8g.drawStr(22, 40, "Tomohawk Tec");
} while ( u8g.nextPage() );
delay (2000);
}
/*===========================================================================================================================================================
mainloop
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
void loop() {
static int lastCounter = 0;
switch (currpage){
case ROOT_MENU: page_rootmenu (); break;
case SUB_MENU1: page_submenu1 (); break;
case SETTINGS_24v: page_submenu1_set24v (); break;
case SUB_MENU2: page_submenu2 (); break;
case SUB_MENU3: page_submenu3 (); break;
case SUB_MENU4: page_submenu4 (); break;
case SUB_MENU5: page_submenu5 (); break;
}
}
/*===========================================================================================================================================================
Rootmenu
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
void page_rootmenu(void) {
boolean btn_select_wasdown = false;
boolean btn_select_isup = false;
uint32_t loopstartms;//tracks when entered the loop
//inner loop
while(true){
loopstartms = millis();//capture start time
Serial.print(Selected_Item);
Previous_Item = Selected_Item -1;
if (Previous_Item < 0 ) {Previous_Item = Num_Items -1;}// prev item below fist make it last
Next_Item = Selected_Item +1;
if (Selected_Item >= Num_Items) {Next_Item = 0;} //next Item last then make it the first
u8g.firstPage();
do {//icon starup positions draw
// Draw for top menu item
u8g.drawBitmapP( 2, 2, 16/8, 16, Icon_bitmap[Previous_Item] );
u8g.setFont(u8g_font_7x14);
u8g.drawStr(22, 15, menu_items[Previous_Item]);
// Draw for middle menu item in bold
u8g.drawBitmapP( 2, 24, 16/8, 16, Icon_bitmap[Selected_Item] );
u8g.setFont(u8g_font_7x14B);
u8g.drawStr(22, 38, menu_items[Selected_Item]);
u8g.drawBitmapP( 120, 0, 8/8, 64, Scroll_handle_bitmap[Selected_Item] );
// Text draw bottom
u8g.drawBitmapP( 2, 46, 16/8, 16, Icon_bitmap[Next_Item] );
u8g.setFont(u8g_font_7x14);
u8g.drawStr(22, 58, menu_items[Next_Item]);
//higlighted bar background position draw
u8g.drawBitmapP( 0, 22, 128/8, 21, epd_bitmap_Highlighted_bar );
//Scroll bar position draw
u8g.drawBitmapP( 120, 0, 8/8, 64, epd_bitmap_Scroll_bar );
//Tagg position draw
u8g.drawBitmapP( 110, 56, 8/8, 8, epd_bitmap_Tagg );
} while ( u8g.nextPage() );
if (digitalRead(BUTTON_SELECT_PIN) == LOW && digitalRead(BUTTON_SELECT_PIN) == LOW) {btn_select_wasdown = true;}
if (digitalRead(BUTTON_SELECT_PIN) == HIGH && digitalRead(BUTTON_SELECT_PIN) == HIGH) {btn_select_isup = true;}
//move in to sub menu
if (btn_select_wasdown && btn_select_isup) {
switch (Selected_Item) {
case 1: currpage = SUB_MENU1; return;
case 2: currpage = SUB_MENU2; return;
case 3: currpage = SUB_MENU3; return;
case 4: currpage = SUB_MENU4; return;
case 5: currpage = SUB_MENU5; return;
}
btn_select_wasdown = false;
btn_select_isup = false;
}
while (millis() - loopstartms < 25){delay(2);}//keep pace
}
}
/*===========================================================================================================================================================
Submenu1
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
void page_submenu1(void) {
boolean btn_select_wasdown = false;
boolean btn_select_isup = false;
uint32_t loopstartms;//tracks when entered the loop
uint8_t sub_pos =0;//selected item pos
const unsigned char* Icon_bitmap_sub[6] = {
epd_bitmap_Icon_settings,
epd_bitmap_Bak_icon_arrow,
epd_bitmap_Pulse_icon,
epd_bitmap_copy_icon,
epd_bitmap_cycle_icon,
epd_bitmap_sensor_icon
};
char sub_menu_items[SUB1_menu_cnt +1] [10] = {
("Setting"),
("Back"),
("Pulse"),
("Imitate"),
("Cycle"),
("Sensor")
};
while(true){
loopstartms = millis();//capture start time
Serial.print(Selected_Item);
Previous_Item = Selected_Item -1;
if (Previous_Item < 0 ) {Previous_Item = SUB1_menu_cnt -1;}// prev item below fist make it last
Next_Item = Selected_Item +1;
if (Selected_Item >= SUB1_menu_cnt) {Next_Item = 0;} //next Item last then make it the first
u8g.firstPage();
do {//icon starup positions draw
// Draw for top menu item
u8g.drawBitmapP( 2, 2, 16/8, 16, Icon_bitmap_sub[Previous_Item] );
u8g.setFont(u8g_font_7x14);
u8g.drawStr(22, 15, sub_menu_items[Previous_Item]);
// Draw for middle menu item in bold
u8g.drawBitmapP( 2, 24, 16/8, 16, Icon_bitmap_sub[Selected_Item] );
u8g.setFont(u8g_font_7x14B);
u8g.drawStr(22, 38, sub_menu_items[Selected_Item]);
u8g.drawBitmapP( 120, 0, 8/8, 64, Scroll_handle_bitmap[Selected_Item] );
// Text draw bottom
u8g.drawBitmapP( 2, 46, 16/8, 16, Icon_bitmap_sub[Next_Item] );
u8g.setFont(u8g_font_7x14);
u8g.drawStr(22, 58, sub_menu_items[Next_Item]);
//higlighted bar background position draw
u8g.drawBitmapP( 0, 22, 128/8, 21, epd_bitmap_Highlighted_bar );
//Scroll bar position draw
u8g.drawBitmapP( 120, 0, 8/8, 64, epd_bitmap_Scroll_bar );
//Tagg position draw
u8g.drawBitmapP( 110, 56, 8/8, 8, epd_bitmap_Tagg );
} while ( u8g.nextPage() );
if (digitalRead(BUTTON_SELECT_PIN) == LOW && digitalRead(BUTTON_SELECT_PIN) == LOW) {btn_select_wasdown = true;}
if (digitalRead(BUTTON_SELECT_PIN) == HIGH && digitalRead(BUTTON_SELECT_PIN) == HIGH) {btn_select_isup = true;}
//move in to sub menu
if (btn_select_wasdown && btn_select_isup) {
switch (Selected_Item) {
case 1: currpage = ROOT_MENU; return;
case 2: currpage = SETTINGS_24v; return;
case 3: currpage = SUB_MENU3; return;
case 4: currpage = SUB_MENU4; return;
case 5: currpage = SUB_MENU5; return;
}
btn_select_wasdown = false;
btn_select_isup = false;
}
}
while (millis() - loopstartms < 25){delay(2);}//keep pace
}
/*===========================================================================================================================================================
Submenu1 settings 24v
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
void page_submenu1_set24v(void) {
boolean btn_select_wasdown = false;
boolean btn_select_isup = false;
uint32_t loopstartms;//tracks when entered the loop
char set24_menu_items[SET24_menu_cnt +1] [15] = {
("Pulse length"),
("Pulse trigger"),
("Pulse delay"),
("Cycle pause ON"),
("Cycle pause OFF"),
("Cycle trigger"),
("Imitate Signal d"),
("Imitate Signal d OFF"),
("Sense voltage IN - OUT"),
("Show V as percent of 24")
};
while(true){
u8g.firstPage();
loopstartms = millis();//capture start time
Serial.print(Selected_Item);
do {// starup positions draw
// Draw for 1st menu item
u8g.setFont(u8g_font_7x14);
u8g.drawStr(2, 15, set24_menu_items[Selected_Item]);
u8g.drawBitmapP( 20, 41, 64/8, 22, epd_bitmap_txt_box24 );
u8g.drawBitmapP( 120, 0, 8/8, 64, Scroll_handle_bitmap[Selected_Item /2] );
//Scroll bar position draw
u8g.drawBitmapP( 120, 0, 8/8, 64, epd_bitmap_Scroll_bar );
//Tagg position draw
u8g.drawBitmapP( 110, 56, 8/8, 8, epd_bitmap_Tagg );
} while ( u8g.nextPage() );
if (digitalRead(BUTTON_SELECT_PIN) == LOW && digitalRead(BUTTON_SELECT_PIN) == LOW) {btn_select_wasdown = true;}
if (digitalRead(BUTTON_SELECT_PIN) == HIGH && digitalRead(BUTTON_SELECT_PIN) == HIGH) {btn_select_isup = true;}
//move in to sub menu
if (btn_select_wasdown && btn_select_isup) {
switch (Selected_Item) {
case 1: //Pulse Lenght var//
; return;
case 2: currpage = SETTINGS_24v; return;
case 3: currpage = SUB_MENU3; return;
case 4: currpage = SUB_MENU4; return;
case 5: currpage = SUB_MENU5; return;
case 6: currpage = ROOT_MENU; return;
case 7: currpage = SETTINGS_24v; return;
case 8: currpage = SUB_MENU3; return;
case 9: currpage = SUB_MENU4; return;
case 10: currpage = SUB_MENU5; return;
}
btn_select_wasdown = false;
btn_select_isup = false;
}
}
while (millis() - loopstartms < 25){delay(2);}//keep pace
}
/*===========================================================================================================================================================
Submenu2
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
void page_submenu2(void) {}
/*===========================================================================================================================================================
Submenu3
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
void page_submenu3(void) {}
/*===========================================================================================================================================================
Submenu4
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
void page_submenu4(void) {}
/*===========================================================================================================================================================
Submenu5
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
void page_submenu5(void) {}
/*===========================================================================================================================================================
Toolbox
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
void read_encoder() {
// Encoder interrupt routine for both pins. Updates counter
// if they are valid and have rotated a full indent
static uint8_t old_AB = 3; // Lookup table index
static int8_t encval = 0; // Encoder value
static const int8_t enc_states[] = {0,-1,1,0,1,0,0,-1,-1,0,0,1,0,1,-1,0}; // Lookup table
old_AB <<=2; // Remember previous state
if (digitalRead(ENC_A)) old_AB |= 0x02; // Add current state of pin A
if (digitalRead(ENC_B)) old_AB |= 0x01; // Add current state of pin B
encval += enc_states[( old_AB & 0x0f )];
// Update counter if encoder has rotated a full indent, that is at least 4 steps
if( encval > 3 ) { // Four steps forward
int changevalue = 1;
if((micros() - _lastIncReadTime) < _pauseLength) {
changevalue = _fastIncrement * changevalue;
}
switch (currpage){
case ROOT_MENU:
if (sub_pos == ROOT_menu_cnt) {sub_pos = 0;}
else {sub_pos ++;} Serial.print(sub_pos); break;
case SUB_MENU1:
if (sub_pos == SUB1_menu_cnt) {sub_pos = 0;}
else {sub_pos ++;} Serial.print(sub_pos); break;
case SETTINGS_24v:
if (sub_pos == SET24_menu_cnt) {sub_pos = 0;}
else {sub_pos ++;} Serial.print(sub_pos); break;
case SUB_MENU2:
if (sub_pos == SUB2_menu_cnt) {sub_pos = 0;}
else {sub_pos ++;} Serial.print(sub_pos); break;
case SUB_MENU3:
if (sub_pos == SUB3_menu_cnt) {sub_pos = 0;}
else {sub_pos ++;} Serial.print(sub_pos); break;
case SUB_MENU4:
if (sub_pos == SUB4_menu_cnt) {sub_pos = 0;}
else {sub_pos ++;} Serial.print(sub_pos); break;
case SUB_MENU5:
if (sub_pos == SUB5_menu_cnt) {sub_pos = 0;}
else {sub_pos ++;} Serial.print(sub_pos); break;
}
_lastIncReadTime = micros();
encval = 0;
}
else if( encval < -3 ) { // Four steps backward
int changevalue = -1;
if((micros() - _lastDecReadTime) < _pauseLength) {
changevalue = _fastIncrement * changevalue;
}
switch (currpage){
case ROOT_MENU:
if ( Selected_Item > ROOT_menu_cnt || Selected_Item == 0) {sub_pos = ROOT_menu_cnt;}
else {sub_pos --;} Serial.print(sub_pos); break;
case SUB_MENU1:
if ( Selected_Item > SUB1_menu_cnt || Selected_Item == 0) {sub_pos = SUB1_menu_cnt;}
else {sub_pos --;} Serial.print(sub_pos); break;
case SETTINGS_24v:
if ( Selected_Item > SET24_menu_cnt || Selected_Item == 0) {sub_pos = SET24_menu_cnt;}
else {sub_pos --;} Serial.print(sub_pos); break;
case SUB_MENU2:
if ( Selected_Item > SUB1_menu_cnt || Selected_Item == 0) {sub_pos = SUB2_menu_cnt;}
else {sub_pos --;} Serial.print(sub_pos); break;
case SUB_MENU3:
if ( Selected_Item > SUB1_menu_cnt || Selected_Item == 0) {sub_pos = SUB3_menu_cnt;}
else {sub_pos --;} Serial.print(sub_pos); break;
case SUB_MENU4:
if ( Selected_Item > SUB1_menu_cnt || Selected_Item == 0) {sub_pos = SUB4_menu_cnt;}
else {sub_pos --;} Serial.print(sub_pos); break;
case SUB_MENU5:
if ( Selected_Item > SUB1_menu_cnt || Selected_Item == 0) {sub_pos = SUB5_menu_cnt;}
else {sub_pos --;} Serial.print(sub_pos); break;
}
_lastDecReadTime = micros();
encval = 0;
}
Selected_Item = sub_pos;
}
//=========================================================================================================