Rozličné výpisy
Zo stránky SensorWiki
-
Prvý program...
-
...bude vyzerať v simulátore takto.
Zakladne vypisy:
basic.showString("Result:")
basic.showNumber(3)
basic.showIcon(IconNames.Yes)
})
# MindPlus
# microbit
from microbit import *
display.scroll(str("Result: "), wait=False, loop=False)
display.scroll(str((str(3))), wait=False, loop=False)
display.show(Image("00000:00009:00090:90900:09000"))
/*!
* MindPlus
* microbit
*
*/
#include <Microbit_Matrix.h>
// Static constants
const uint8_t bbcBitmap[][5] = {
{B00000,B00001,B00010,B10100,B01000}
};
// Main program start
void setup() {
MMatrix.print("Result: ");
MMatrix.print((String(3)));
MMatrix.show(bbcBitmap[0]);
}
void loop() {
}
#include "MicroBit.h"
MicroBit uBit;
MicroBitImage SMILEY1("0,1,0,1,0 \n"
"0,1,0,1,0 \n"
"0,0,0,0,0 \n"
"1,0,0,0,1 \n"
"0,1,1,1,0 \n");
MicroBitImage SMILEY2("0,0,0,1,0 \n"
"0,0,0,1,0 \n"
"0,0,0,0,0 \n"
"1,0,0,0,1 \n"
"0,1,1,1,0 \n");
int main()
{
uBit.init(); // setup
while(1) // loop
{
uBit.display.print(SMILEY1);
uBit.sleep(1000);
uBit.display.print(SMILEY2);
uBit.sleep(200);
}
}
Späť na zoznam príkladov....