chrome serial port, micropython m5stack atom lite esp32 demo

preview_player
Показать описание
chrome serial port, micropython m5stack atom lite esp32 demo
youtube won't allow angle brackets for source code

code:

remember to run html replace %lt with less than symbol and %gt with greater than symbol
// chrome://flags/#enable-experimental-web-platform-features
// tested on chrome 87
< = less than symbol
> = greater than symbol
youtube don't like angle brackets

html:
< html >

< button onclick="test()" > connect < button >
< button id="r" type="button" > red < /button >
< button id="g" type="button" > green < /button >
< button id="b" type="button" > blue < /button >

< script >
var port;
function sendByte(b){
}}

sendByte(new Uint8Array([114])); // ascii 'r'
});

sendByte(new Uint8Array([103])); // ascii 'g'
});

sendByte(new Uint8Array([98])); // ascii 'b'
});

const test = async function () {
}
< /script >

< /html >

// micropython m5stack atom lite:

import sys, select, time, machine, neopixel
np = neopixel.NeoPixel(machine.Pin(27), 1)

while 1:
if (ch == 'r'):
np[0] = (255,0,0)
elif (ch == 'g'):
np[0] = (0,255,0)
elif (ch == 'b'):
np[0] = (0,0,255)
Рекомендации по теме
Комментарии
Автор

More context! I am looking for something similar

Edit: just found the description lol thanks man!

aarriikknnll
visit shbcf.ru