106 #include "uStepper.h" 130 static unsigned char fw_bits[] = {
131 0x41, 0x00, 0xc3, 0x00, 0xc7, 0x01, 0xcf, 0x03, 0xdf, 0x07, 0xcf, 0x03,
132 0xc7, 0x01, 0xc3, 0x00, 0x41, 0x00 };
133 static unsigned char bw_bits[] = {
134 0x10, 0x04, 0x18, 0x06, 0x1c, 0x07, 0x9e, 0x07, 0xdf, 0x07, 0x9e, 0x07,
135 0x1c, 0x07, 0x18, 0x06, 0x10, 0x04 };
138 static unsigned char rec_bits[] = {
139 0xfc, 0x00, 0xfe, 0x01, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03,
140 0xff, 0x03, 0xff, 0x03, 0xfe, 0x01, 0xfc, 0x00 };
141 static unsigned char stop_bits[] = {
142 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03,
143 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03 };
144 static unsigned char pse_bits[] = {
145 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00,
146 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00 };
148 #define play_height 11 149 static unsigned char play_bits[] = {
150 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x1f, 0x0f, 0x07, 0x03, 0x01 };
151 #define loop_width 11 152 #define loop_height 10 153 static unsigned char loop_bits[] = {
154 0x04, 0x00, 0x08, 0x00, 0x9e, 0x03, 0x09, 0x04, 0x05, 0x04, 0x01, 0x05,
155 0x81, 0x04, 0xce, 0x03, 0x80, 0x00, 0x00, 0x01 };
156 #define logo_width 90 157 #define logo_height 16 158 static unsigned char logo_bits[] = {
159 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
160 0x00, 0x80, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
161 0x00, 0xc0, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
162 0x00, 0xc0, 0xc7, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
163 0x3e, 0xcf, 0x07, 0xfc, 0xe3, 0xc3, 0x7b, 0x78, 0x0f, 0x3e, 0x9c, 0x01,
164 0xdf, 0xcf, 0x3f, 0xfe, 0xf3, 0xf7, 0xff, 0xfe, 0x1f, 0x7f, 0xff, 0x03,
165 0x3e, 0xcf, 0xff, 0x78, 0x38, 0xc7, 0xf3, 0x78, 0x9e, 0x73, 0xfe, 0x03,
166 0x3c, 0x8f, 0xff, 0x79, 0xfc, 0xcf, 0xf3, 0x79, 0xde, 0xff, 0xbc, 0x01,
167 0x1c, 0x47, 0xfe, 0x78, 0xfc, 0xcf, 0xf3, 0x78, 0xbe, 0x7f, 0x1e, 0x00,
168 0x3c, 0xef, 0xf0, 0x79, 0x38, 0xc0, 0xf3, 0x79, 0xde, 0x03, 0x1e, 0x00,
169 0xbe, 0xcf, 0xff, 0x78, 0x78, 0xc4, 0xf3, 0x78, 0x9e, 0x47, 0x3e, 0x00,
170 0xfc, 0xdf, 0x7f, 0xf8, 0xf3, 0xc7, 0x7f, 0xf8, 0x0f, 0x7f, 0x7e, 0x00,
171 0x38, 0x07, 0x3f, 0xf0, 0xe1, 0xc3, 0x3f, 0xf8, 0x07, 0x3e, 0x7f, 0x00,
172 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x7c, 0x00, 0x00, 0x00, 0x00,
173 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0xfc, 0x00, 0x00, 0x00, 0x00,
174 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0xf8, 0x00, 0x00, 0x00, 0x00 };
222 U8G2_SSD1306_128X64_NONAME_1_4W_SW_SPI *
u8g2;
317 void idlePage(
bool pidMode,
float pos);
329 void recordPage(
bool pidMode,
bool recorded, uint8_t index,
float pos);
339 void playPage(
bool loopMode,
bool pidMode, uint8_t index);
349 void pausePage(
bool loopMode,
bool pidMode, uint8_t index);
void loop(void)
Contains the main logic of the shield functionality, e.g. transition between states (idle...
void recordMode(void)
Holds the record logic, showing the record page and recording positions from user input...
uStepper stepper
Creates an uStepper instance.
void idleMode(void)
Holds the idle logic; page to show, what buttons to enable etc.
void setup(uint16_t acc=1500, uint16_t vel=1000, uint8_t uStep=SIXTEEN, uint16_t fTol=10, uint16_t fHys=5, float P=1.0, float I=0.02, float D=0.006)
Initializes buttons, OLED, uStepper and BT-module.
void recordPage(bool pidMode, bool recorded, uint8_t index, float pos)
Holds the code for the record page of the OLED.
void idlePage(bool pidMode, float pos)
Holds the code for the idle page of the OLED.
U8G2_SSD1306_128X64_NONAME_1_4W_SW_SPI * u8g2
void playMode(void)
Holds the play logic, showing play page and running the recorded sequence.
void pauseMode(void)
Holds the pause logic, showing the pause page and pausing the playing of a sequence.
void fastForward(void)
Holds the fast forward logic for driving the stepper motor manually with the pushbuttons.
void inputs(void)
Reads the four buttons and writes their value; no push, short push or long push, to global variables...
void fastBackward(void)
Holds the fast backward logic for driving the stepper motor manually with the pushbuttons.
void startPage(void)
Holds the code for the start page of the OLED.
void pausePage(bool loopMode, bool pidMode, uint8_t index)
Holds the code for the pause page of the OLED.
uint8_t buttonState(uint8_t button, uint8_t nmbr)
Returns the button state of the appropriate button.
egoShield(void)
Constructor of egoShield class.
void playPage(bool loopMode, bool pidMode, uint8_t index)
Holds the code for the play page of the OLED.