21.12.2021 Views

Un universo de extensiones con mBlock5

Se describe cómo utilizar las diferentes extensiones para objetos y como crear extensiones para módulos en placas arduino

Se describe cómo utilizar las diferentes extensiones para objetos y como crear extensiones para módulos en placas arduino

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

UN UNIVERSO DE EXTENSIONES EN MBLOCK5

0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,

0xff, 0xff, 0xff, 0xff,

0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,

0xff, 0xff, 0xff, 0xff

};

Code: Utilizamos la función display.drawBitmap…

if (/*{imagen}*/ == 0)

{

// Dibujar bombilla OFF

display.drawBitmap(0,0,BombillaOFFBitmap,128,64,1);

}

if (/*{imagen}*/ ==1)

{

// Dibujar bombilla ON

display.drawBitmap(0,0,BombillaONBitmap,128,64,1);

}

Así se vería la bobilla al utilizar este comando: Esta OLED es de dos colores (amarillo y azul).

Ya podemos descargar la extensión para probar o testear si funciona correctamente.

4.5.3. Probando la extensión

Como vamos a montar y programar circuitos electrónicos comenzaremos viendo cómo se

conecta una pantalla OLED I2C al dispositivo Arduino Uno.

Nuestra pantalla tiene 4 pines, que son: GND, V CC, SCL y SDA

SUSANA OUBIÑA FALCÓN PÁGINA 200 DE 207

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!