Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const frames = [
{
width: 89,
height: 64,
bpp: 1,
transparent: 0,
buffer: E.toArrayBuffer(
atob(
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAwAAAAAAAAAAAAgAEAAAAAAAAAAAMAABAAAAAAAAAABAAABAAAAAAAAAAMB/+AgAAAAAAAAAgf//ggAAAAAAAACD///wgAAAAAAAAIf///wgAAAAAAAAh4///xAAAAAAAACHg/w/BAAAAAAAAIfB+AcCAAAAAAAAB+B4AYCAAAAAAABH8HwAQEAAAAAAAAP4HDwwAAAAAAAAI/weLRyIAAAAAAAR/w4fh+IAAAAAABH//w/j8QAAAAAACP//j/H8AAAAAAAEf//H+P4gAAAAAAB//+P8PwAAAAAAAD//8f4fwAAAAAABH//4/w/iAAAAAACP//w/j/EAAAAAAI///h/H+AAAAAAAR///j+P8AAAAAAAH///H8f4AAAAAACP//+Hw/wAAAAAAAf//8Lj/gAAAAAAR///8KH/EAAAAAAD///4cf+IAAAAACH///4Q/8AAAAAAAP///4D/xAAAAAAQP///wH/iAAAAABAf///wf/AAAAAAAI////w/8AAAAAAIw////j/4gAAAAAjx////n/wAAAAACHh//////EAAAAAIfh/////+IAAAAAh/h/////8AAAAACH/h/////xAAAAAMf/h/////iAAAAAR//g/////AAAAABH//gP///8QAAAAEP//wB///4gAAAAQ///4D///xAAAABD///+H///iAAAAEP////////EAAAAQ////////+IAAABD////////+QAAAEP////////8AAAAQ/////////4gAAAj/////////xAAACP/////////iAAAEf/////////gAAAA//////////EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=='
)
)
},
{
width: 89,
height: 64,
bpp: 1,
transparent: 0,
buffer: E.toArrayBuffer(
atob(
'AAAAAAAAAAAAAAAAAAAAADBAAAAAAAAAAAAAQAwAAAAAAAAAAACAAIAAAAAAAAAAAQAAIAAAAAAAAAADA/4EAAAAAAAAAAIP/8EAAAAAAAAAAg//+AAAAAAAAAACH//+AAAAAAAAAAIf//+IAAAAAAAAAgH//8IAAAAAAAACAP//wIAAAAAAAAAQP8PgQAAAAAAAARgfgHAQAAAAAAABHA+AGAQAAAAAAACOB4AMYgAAAAAAAI+Hw8P4gAAAAAAAR//i0fxAAAAAAAAH/+H4fxAAAAAAACP/8f4/iAAAAAAAEf/4/x/gAAAAAAAB//x/j/AAAAAAAAD//j/H+IAAAAAABH//H+P8QAAAAAACP/+P8f4AAAAAAAE//8P4/5AAAAAAAB//4fx/yAAAAAAAj//4/j/gAAAAAABH//x+H/AAAAAAACP//h0P+IAAAAAAAf//j4/8QAAAAAAB///Ch/4gAAAAAAD//+GH/xAAAAAAAH//+Ef/iAAAAAAAP//+A//EAAAAAAEf//+D/+IAAAAAAAf//8H/8QAAAAAAQ///8f/4gAAAAAAg///8//xAAAAAAAB///7//yAAAAAAAB//////gAAAAAAIh//////EAAAAAARj/////+IAAAAAAjh/////+AAAAAAAPh/////8QAAAAAEfg/////8QAAAAAA/gf////4gAAAAAj/wB////4gAAAACP/4D////wAAAAAA///H////xAAAAAD////////xAAAAAP////////iAAAAA/////////iAAAAj/////////EAAACP/////////AAAAI/////////+IAAAB/////////8QAABH/////////8AAACP/////////4gAAE//////////xAAAB//////////gAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=='
)
)
},
{
width: 89,
height: 64,
bpp: 1,
transparent: 0,
buffer: E.toArrayBuffer(
atob(
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwA4AAAAAAAAAAAYAAEAAAAAAAAAABAAAAAAAAAAAAAAID/8CAAAAAAAAAAg//+AAAAAAAAAACH///AAAAAAAAAAIf///EAAAAAAAAAh//8+EAAAAAAAACHD/AeAAAAAAAAAEeD8AYIAAAAAAAAR8HwAQAAAAAAAAAj4HD4gQAAAAAAACPwOFQAAAAAAAAAEfg8fxAgAAAAAAAB/hw/jxAAAAAAAAj//h/DwAAAAAAABH//D+HiAAAAAAACP/+H+PCAAAAAAAA//8P4fCAAAAAAAR//4fw/CAAAAAAAj//w/x/CAAAAAABH//x/D/EAAAAAAAf//j+H/EAAAAAAA///D8f+IAAAAAAR//+H4/+AAAAAAAj//+Ph/8AAAAAABH//8LH/5gAAAAACP//8cP/xAAAAAAEf//4Q//gAAAAAAA///4B//AAAAAAAB///4H/+AAAAAAAj///wf/8AAAAAABH///w//4AAAAAACP///z//wAAAAAAAP///n//iAAAAAAAf//////EAAAAAAI///////EAAAAAAA//////+EAAAAAAR//////+CAAAAAAh//////+BAAAAABB///////BAAAAAAB///////AAAAAAEB///////ggAAAAAh///////gAAAAARg///////xAAAAAHgP//////hAAAACPwB//////hAAAAAf4D//////iAAAAR/+P//////iAAABD/////////EAAACP/////////AAAAI/////////+IAAAB/////////8QAABH/////////8AAACP/////////4gAAEf/////////xAAAB//////////gAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=='
)
)
},
{
width: 89,
height: 64,
bpp: 1,
transparent: 0,
buffer: E.toArrayBuffer(
atob(
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYA8AAAAAAAAAAACAABAAAAAAAAAAAQAAAgAAAAAAAAABA/8AQAAAAAAAAAEP//gQAAAAAAAAAQ///4QAAAAAAAABD///4QAAAAAAAAAP///4QAAAAAAAAI////4QAAAAAAAAjj/8/4AAAAAAAABHD/AcYgAAAAAAAEcD8AYZAAAAAAAAI8HwAAwAAAAAAAAD4Ph4BiAAAAAAABHweF4DiAAAAAAACfh8PwvAAAAAAAAI/j4/h/EAAAAAAAR//x/j/EAAAAAAAH//j/H+AAAAAAACP//H+P+IAAAAAAEf/+P8f8AAAAAAAB//8f4/8AAAAAAAD//4/x/4gAAAAABH//w/j/xAAAAAACP//h/H/iAAAAAAA///j8P/AAAAAAAB///H4/+AAAAAAAD//+Hx/8QAAAAAAH//+PD/4gAAAAAAP//8MP/xAAAAAAAf//8I//gAAAAAAAf//8B//AAAAAAAA///4H/+QAAAAAAR///4P/8AAAAAAAj///4//4gAAAAAAH///x//xAAAAAABH///3//xAAAAAACP//////gAAAAAACP//////iAAAAAAEP//////iAAAAAAEf//////iAAAAAAAf//////BAAAAAAIf//////hgAAAAAQf//////gQAAAAAgf//////gIAAAABAf//////wEAAAACIP//////4CAAAAE8H//////8BAAAAB8AP//////BAAAAD+Af//////hAAAAH/g///////hAAAAP/////////iAAAAf/////////iAAAA//////////gAAAB//////////EAAAgAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAA=='
)
)
},
{
width: 89,
height: 64,
bpp: 1,
transparent: 0,
buffer: E.toArrayBuffer(
atob(
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMA4AAAAAAAAAAACAAGAAAAAAAAAAAYAABAAAAAAAAAABAf4AgAAAAAAAAAAH//AgAAAAAAAAAg///ggAAAAAAAACD///wgAAAAAAAAAf///wgAAAAAAAAB////wAAAAAAAABH////xAAAAAAAAEP////wAAAAAAAAQ/////iAAAAAAAAj4fwHxEAAAAAAACPwfAHDEAAAAAAAAfg8AGGAAAAAAAAR/Bw8MGIAAAAAABH+DjUIeIAAAAAACP8HH4Y8IAAAAAAA/8cP4/8AAAAAAAR//4fx/8QAAAAAAj//x/j/4gAAAAABP//h/D/4AAAAAAAf//D+H/xAAAAAAI//+P8P/iAAAAAAR//8P4f/EAAAAAAD//8fw/+IAAAAAAH//4/j/8QAAAAAAP//x/H/4gAAAAAAf//h+P/xAAAAAAA///j4f/iAAAAAAB///Ch//AAAAAAAj//+FD/+AAAAAABH//+EP/4AAAAAACP//+A//4AAAAAAAf//8B//xAAAAAAAf//8H//iAAAAAAA///8P//iAAAAAAR///8///AAAAAAAD///5///AAAAAAAD///////AAAAAAAD///////CAAAAAAH///////CAAAAAEH///////BAAAAAAH///////AgAAAAQH///////gYAAAAiH///////gEAAAAGD///////4CAAABGD///////8BAAACPA////////BAAAAPAD///////hAAAEfgH///////hAAAA/8P///////hAAAI//////////gAAAB//////////iAAAR//////////AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=='
)
)
},
{
width: 89,
height: 64,
bpp: 1,
transparent: 0,
buffer: E.toArrayBuffer(
atob(
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAYAAAAAAAAAAACAACAAAAAAAAAAAYAABAAAAAAAAAABA/8BAAAAAAAAAAAH//ggAAAAAAAAAA///ggAAAAAAAACH///wAAAAAAAAAAf///xAAAAAAAAAB////xAAAAAAAABHx///gAAAAAAAAEfB//+CAAAAAAAAQ+B/AYEAAAAAAAAD8D8AYAAAAAAAACP4HwAAIAAAAAAAI/wfj4AAAAAAAAAB/w+FQ8IAAAAAABH//8fx8IAAAAAAAf//4/j8IAAAAAAI///x/D8IAAAAAAD///j/H8IAAAAAAH//+H+P8AAAAAAAP//+P8f8QAAAAAAf//8f4/8AAAAAAA///4/x/4gAAAAAB///x/j/wAAAAAAD///j+H/gAAAAAAH///D8f/AAAAAAAP///Ho/+AAAAAACP//+Ph/8QAAAAAEf//8LH/4gAAAAAA///8MP/wAAAAAAB///8Y//gAAAAAAD///4B//AAAAAAAH///4H/+QAAAAAAP///4f/8gAAAAAAP///w//4AAAAAAIf///z//xAAAAAAQ////3//iAAAAAAg///////iAAAAABA///////CAAAAACB///////CAAAAAEx///////CAAAAAJh///////DAAAAADh///////BAAAAAHh///////hAAAAAPh///////ggAAAAfh///////gwAAAE/g///////wQAAAI/gf//////wIAAAR/wB//////4AAAAD/wB//////4AAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=='
)
)
},
{
width: 89,
height: 64,
bpp: 1,
transparent: 0,
buffer: E.toArrayBuffer(
atob(
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwADAAAAAAAAAAAEAAAgAAAAAAAAAAgAAAgAAAAAAAAAEB//ggAAAAAAAAAQf//wgAAAAAAAAAD///wgAAAAAAAAAP///wgAAAAAAAAA////xAAAAAAAAAH////xAAAAAAAAAf////gAAAAAAAAB/h///CAAAAAAAAH/B//8AAAAAAAAEf+D+B4EAAAAAAAQ/8H4BwAAAAAAAAD/4PgBgIAAAAAACP/weHhiIAAAAAAI//x8Zj8IAAAAAAR///4tD8QAAAAAAH///hfH8QAAAAACP///H6P4AAAAAAEf//+L0f4AAAAAAB///8Xo/xAAAAAAD///4vR/yAAAAAAH///xej/gAAAAAAP///h9H/EAAAAAAf///C6P+IAAAAAA////F0f8QAAAAAB///+Lo/8AAAAAAD///8fx/5AAAAAAD///4VD/wAAAAAAH///4uP/gAAAAAAP///wof/AAAAAAAf///wh/+AAAAAAQf///hH/4gAAAAAg////gP/xAAAAAAA////g//EAAAAAAY////h/8AAAAAAIx////H/4gAAAAABx////P/iAAAAABHx//////AAAAAACPx/////8QAAAAAA/w/////4gAAAAAR/w/////4DAAAAAH/wf////wAwAAACP/wP////4AEAAAEf/4A/////gEAAAI//8B/////4AAAAQAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAA=='
)
)
},
{
width: 89,
height: 64,
bpp: 1,
transparent: 0,
buffer: E.toArrayBuffer(
atob(
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwBwAAAAAAAAAAAIAAIAAAAAAAAAABAAAEAAAAAAAAAAEH/8EAAAAAAAAAAg//+EAAAAAAAAACH///EAAAAAAAAAIf///AAAAAAAAAAh///+IAAAAAAAACP///+AAAAAAAAAI////8QAAAAAAAAj+f/n8gAAAAAAACP4f4DwAAAAAAAAIfw/gDBAAAAAAAAB/g+ACAAAAAAAABH/B8fACAAAAAAAEf+DwuAAAAAAAAAR/+Pj+PEAAAAAAAj///H8fAAAAAAACP//+P4eIAAAAAAA///8f4+AAAAAAAR///4/x8QAAAAAAn///x/j8gAAAAAAP///j/H4AAAAAAEf///H+PxAAAAAAJ///+P4fiAAAAAAD///8Px/kAAAAAAH///8fj/IAAAAACP///4/H+AAAAAAEf///w8P8AAAAAAQ////xw/5AAAAABA////hj/yAAAAAEB////jH/EAAAAAQx////gf+AAAAAADj////A/4gAAAAAPj////D/xAAAAAA/H////H/gAAAAAD/H////f/AAAAAAP/H/////+AAAAAA//H/////8AAAAAj/+H/////4AAAACP/+H/////xAAAAI//+H/////yAAAAB///D/////gAAABH///A/////EAAAEf///gH////EAAAI////gH///+EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAA=='
)
)
},
{
width: 89,
height: 64,
bpp: 1,
transparent: 0,
buffer: E.toArrayBuffer(
atob(
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAwAAAAAAAAAAAIAAIAAAAAAAAAABAAAEAAAAAAAAAAAD/4CAAAAAAAAAAgf/8CAAAAAAAAACD//+CAAAAAAAAAAf///CAAAAAAAAABx/+fAAAAAAAAAEHh/gGEAAAAAAAAQ+B+AEAAAAAAAABD8D4AAIAAAAAAAEP4Hw8AQAAAAAAAQ/wPC8AgAAAAAABD/weH4QAAAAAAAAP/x8f4xAAAAAAAA///4/xiAAAAAAAj///x/jiAAAAAACP///j/HEAAAAAAIf///H+PAAAAAAAB///+P8eIAAAAABH///8P48AAAAAAEP///4fx8QAAAAAAf///w/j4AAAAAAg////x/H4AAAAAAB////h8PxAAAAAED////D4/iAAAAAIH////Gh/gAAAAADH///+GH/AAAAAAGP///+EP+AAAAACMf///+A/8AAAAAAYf///8D/4AAAAAR4////8H/wAAAABDw////8f/EAAAAEPx////4/+IAAAAQ/x////7/8QAAABD/h//////wAAAAEP/h//////iAAAAQ//h//////EAAABD//h/////8QAAAEP//g/////4gAAAQ///gP////wAAAAD///wB////EAAAAP///4D///+IAAAQ////+H///8AAABD/////////4AAACP/////////wAAAI//////////gAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=='
)
)
},
{
width: 89,
height: 64,
bpp: 1,
transparent: 0,
buffer: E.toArrayBuffer(
atob(
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAHAAAAAAAAAAABAAAgAAAAAAAAAAIAAAgAAAAAAAAABAP/AQAAAAAAAAAED//wQAAAAAAAAAgf//wQAAAAAAAACD///4AAAAAAAAAIOP//4gAAAAAAAAh4P//ggAAAAAAACHwP4DAAAAAAAAAIfgfgCBAAAAAAAAh/A+AACAAAAAAACH+B4OAAAAAAAAAIf8Hw+EEAAAAAAAh/8Pj8OIAAAAAABH//+H8MQAAAAAAEP//8P4YgAAAAAAQ///4fwxAAAAAAAj///w/xhAAAAAACP///h/jiAAAAAAIf///D/HAAAAAAAR///+H+PEAAAAABD///8P8eAAAAAAAH///8fw+IAAAAAIf///4/h8QAAAAAA////w/H4AAAAABB////h+P4gAAAAAD////h4fxAAAAAID////Ch/gAAAAABH////DD/gAAAAAGP///+EP/AAAAACMf///+A/+AAAAAEYf///+B/8AAAAAQ4////+H/wAAAAADw////8P/iAAAAAPw////8//EAAAAIfh////9/+IAAAAh/h//////4AAAACH/h//////xAAAAAf/h//////AAAABB//g/////+IAAAEH//g/////4AAAAQf//gP////xAAABB///gB////AAAAEP///wD///+IAAAQ////8H///8QAABD/////////wAAAEP/////////iAAAQ//////////EAAAD/////////8IAACP/////////4AAAAf/////////wAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=='
)
)
}
];
let frame = 0;
const lastFrame = frames.length - 1;
let blinkLed = true;
let interval = 200;
let timerId;
const animate = () => {
setTimeout(() => {
if (frame > lastFrame) {
frame = 0;
}
if (blinkLed) LED.toggle();
g.clear();
g.drawImage(frames[frame++], 0, 0);
g.flip();
animate();
}, interval);
};
const reduceInterval = () => {
interval = Math.max(interval - 50, 50);
};
const increaseInterval = () => {
interval += 50;
};
setWatch(
() => {
blinkLed = !blinkLed;
if (!blinkLed) LED.reset();
},
BTN2,
{ repeat: true }
);
setWatch(reduceInterval, BTN1, { repeat: true });
setWatch(increaseInterval, BTN4, { repeat: true });
animate();
save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment