none
Small Basic with micro:bit RRS feed

All replies

  • My first program for micro:bit is HQX644.

    Usage:

    1. Install Mu and [Flash] null code to the micro:bit with USB cable.
    2. Download HQX644 and modify COM port if necessary.
    3. Run HQX644. 
    4. Push the reset button of the micro:bit to run MicroPython. 
    5. Type Python commands such like:
      from microbit import *
      display.show(Image.HAPPY)

    Screen shot of a program Python Console for micro:bit

    See Also


    Nonki Takahashi





    Thursday, August 24, 2017 12:47 PM
    Moderator
  • My second program is KKK886-0.  This program is almost the same with one for Arduino.

    Usage:

    1. Visit makecode.microbit.org and paste following JavaScript program.
    2. Save and copy to MICROBIT.
    3. Run KKK886-0 (with modification COM if needed).
    4. Push reset button of micro:bit.
    5. Push A button of micro:bit few times.

    let t = 0
    basic.forever(() => {
        if (t != input.temperature()) {
            t = input.temperature()
            serial.writeNumber(t)
            serial.writeLine("")
        }
        basic.pause(500)
    })
    input.onButtonPressed(Button.A, () => {
        basic.showNumber(input.temperature())
        serial.writeNumber(input.temperature())
        serial.writeLine("")
    })

    Screen shot of makecode.microbit.org

    Screen shot of a program Thermometer 0.2


    Nonki Takahashi



    Thursday, August 24, 2017 3:03 PM
    Moderator
  • Hi Team,

    Can We Program For micro:bit compatible board 'chibi:bit' By Using Small Basic.

    Thanks,

    Thursday, August 24, 2017 3:14 PM
  • Hi Team,

    Can We Program For micro:bit compatible board 'chibi:bit' By Using Small Basic.

    Thanks,

    Hello, RoshanPriyaKumar.

    Both micro:bit / chibi:bit needs their own programs.  The first sample above is Python interpreter.  The second sample above is Blocks / JavaScript program.  Then Small Basic program can communicate these programs in the boards via COM (serial) port and USB cable. 


    Nonki Takahashi

    Thursday, August 24, 2017 3:36 PM
    Moderator
  • Hi Team,

    How To Make Small Basic program communicate these programs in the boards via COM (serial) port and USB cable?

    Thanks,


    Sunday, August 27, 2017 1:02 PM
  • Hi Team,

    How To Make A Then Small Basic program communicate these programs in the boards via COM (serial) port and USB cable?

    Thanks,


    Small Basic programs use LDCommPort object to communicate with micro:bit.  Programs HQX644 and KKK886-0 above are the samples.

    Nonki Takahashi

    Sunday, August 27, 2017 2:17 PM
    Moderator
  • I wrote a graphics program for micro:bit (GMT047).

    Screen shot of a program micro:bit


    Nonki Takahashi

    Monday, August 28, 2017 12:42 PM
    Moderator
  • I wrote a graphics program for chibi:bit (HPL140).

    Screen shot of a program chibi:bit


    Nonki Takahashi

    Monday, August 28, 2017 12:44 PM
    Moderator
  • updated: HPL140-1

    • added flashing to central led
    • zoom in/out w mswheel
    • rotate by rightclick+wheel
    • code reduced&compacted

    Tuesday, August 29, 2017 3:07 AM
  • added computer vision effect: HPL140-2

    after rotating/zooming doubleclick window to start compvision

    move mouse to display zoomed region on chibi leds

    every doubleclick updates zoom image 

    best shown on white/black zones


    • Edited by Tryhest Tuesday, August 29, 2017 3:56 AM
    Tuesday, August 29, 2017 3:55 AM
  • now a possible future chibi v2 with rgb leds: HPQ689

    doubleclick window to start rgb  leds and move cursor around


    • Edited by Tryhest Tuesday, August 29, 2017 4:50 AM
    Tuesday, August 29, 2017 4:49 AM
  • This is a game using micro:bit as a controller: QZN342-6.

    Micro:bit program is switch.

    Screen shot of a program Turtle Dodger 0.7b


    Nonki Takahashi

    Friday, September 1, 2017 3:14 PM
    Moderator
  • converted to xamarin chibibit simualtor:

    #r "SmallBasicLibrary"
    using Microsoft.SmallBasic.Library;
    
    Primitive LF = Text.GetCharacter(10);
    public int gw = 598;
    public int gh = 428;
    public Primitive[] shape=new Primitive[120];
    public Primitive[,] objLED =new Primitive[6,6];
    public int shWidth=0;
    public int shHeight=0;
    
    GraphicsWindow.BackgroundColor="teal";
    GraphicsWindow.Width = gw;
    GraphicsWindow.Height = gh;
    GraphicsWindow.Title = "chibi:bit";
    
    Shapes_Init();
    
    public int scale = 1;
    public int angle = 0;
    
    Shapes_Add(10,10,1,115);
    FindLEDs(1,115);
    public Primitive img = "" + LF;
    img = img + " . # # # . " + LF;
    img = img + " # . . . # " + LF;
    img = img + " # . . . # " + LF;
    img = img + " # . . . # " + LF;
    img = img + " . # # # . " + LF;
    ShowLEDs();
    while (true){
    OnLED(2,2);
    Program.Delay(1000);
    OffLED(2,2);
    Program.Delay(1000);
    }
    public void FindLEDs(int iMin, int iMax){
      for (int i = iMin; i<= iMax; i++){
        Primitive shp = shape[i];
        if (Text.StartsWith(shp["name"], "LED ") ){
          Primitive name = shp["name"];
          int x = Text.GetSubText(name, 5, 1);
          int y = Text.GetSubText(name, 7, 1);
          objLED[x,y] = shp["obj"];
        }
      }
    }
    
    public void ShowLEDs(){
      int p = 1;
      int y = 0;
      int x = 0;
      while (p <= Text.GetLength(img)){
        char c = (char)(Text.GetSubText(img, p, 1));
       switch (c){
        case '.':
          Shapes.HideShape(objLED[x,y]);
          break;
        case '#':
          Shapes.ShowShape(objLED[x,y]);
          break;
        }
    
        if (Text.IsSubText(".#", c) ){
          x = x + 1;
          if (4 < x ){
            x = 0;
            y = y + 1;
          }
        }
        p = p + 1;
        }
      }
    
    public void OnLED(int x, int y){
      Shapes.ShowShape(objLED[x,y]);
    }
    public void OffLED(int x, int y){
      Shapes.HideShape(objLED[x,y]);
    }
    
    public void Shapes_Init(){
    
      shape[1] = "func=rect;x=8;y=0;width=150;height=8;bc=#006666;pw=0;name=top;";
      shape[2] = "func=ell;x=0;y=0;width=16;height=16;bc=#006666;pw=0;name=corner;";
      shape[3] = "func=ell;x=150;y=0;width=16;height=16;bc=#006666;pw=0;name=corner;";
      shape[4] = "func=rect;x=0;y=8;width=166;height=110;bc=#006666;pw=0;name=board;";
      shape[5] = "func=text;x=168;y=177;text=chibi:bit;fs=20;fn=Trebuchet MS;bc=#000000;";
      shape[6] = "func=line;x=0;y=26;x1=0;y1=0;x2=68;y2=0;pc=#FFFFFF;pw=3;name=line;";
      shape[7] = "func=line;x=98;y=26;x1=0;y1=0;x2=68;y2=0;pc=#FFFFFF;pw=3;name=line;";
      shape[8] = "func=ell;x=77;y=26;width=14;height=14;bc=Transparent;pc=#FFFFFF;pw=3;name=mouth;";
      shape[9] = "func=rect;x=69;y=18;width=28;height=17;bc=#006666;pw=0;name=mouth;";
      shape[10] = "func=ell;x=68;y=20;width=12;height=12;bc=Transparent;pc=#FFFFFF;pw=3;name=eye;";
      shape[11] = "func=ell;x=88;y=20;width=12;height=12;bc=Transparent;pc=#FFFFFF;pw=3;name=eye;";
      shape[12] = "func=line;x=77;y=12;x1=0;y1=9;x2=8;y2=0;pc=#FFFFFF;pw=3;name=switch;";
      shape[13] = "func=rect;x=56;y=47;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[14] = "func=rect;x=56;y=49;width=4;height=7;bc=#FF0000;pw=0;name=LED 0,0;";
      shape[15] = "func=rect;x=56;y=60;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[16] = "func=rect;x=56;y=62;width=4;height=7;bc=#FF0000;pw=0;name=LED 0,1;";
      shape[17] = "func=rect;x=56;y=73;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[18] = "func=rect;x=56;y=75;width=4;height=7;bc=#FF0000;pw=0;name=LED 0,2;";
      shape[19] = "func=rect;x=56;y=86;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[20] = "func=rect;x=56;y=88;width=4;height=7;bc=#FF0000;pw=0;name=LED 0,3;";
      shape[21] = "func=rect;x=56;y=99;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[22] = "func=rect;x=56;y=101;width=4;height=7;bc=#FF0000;pw=0;name=LED 0,4;";
      shape[23] = "func=rect;x=69;y=47;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[24] = "func=rect;x=69;y=49;width=4;height=7;bc=#FF0000;pw=0;name=LED 1,0;";
      shape[25] = "func=rect;x=69;y=60;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[26] = "func=rect;x=69;y=62;width=4;height=7;bc=#FF0000;pw=0;name=LED 1,1;";
      shape[27] = "func=rect;x=69;y=73;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[28] = "func=rect;x=69;y=75;width=4;height=7;bc=#FF0000;pw=0;name=LED 1,2;";
      shape[29] = "func=rect;x=69;y=86;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[30] = "func=rect;x=69;y=88;width=4;height=7;bc=#FF0000;pw=0;name=LED 1,3;";
      shape[31] = "func=rect;x=69;y=99;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[32] = "func=rect;x=69;y=101;width=4;height=7;bc=#FF0000;pw=0;name=LED 1,4;";
      shape[33] = "func=rect;x=82;y=47;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[34] = "func=rect;x=82;y=49;width=4;height=7;bc=#FF0000;pw=0;name=LED 2,0;";
      shape[35] = "func=rect;x=82;y=60;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[36] = "func=rect;x=82;y=62;width=4;height=7;bc=#FF0000;pw=0;name=LED 2,1;";
      shape[37] = "func=rect;x=82;y=73;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[38] = "func=rect;x=82;y=75;width=4;height=7;bc=#FF0000;pw=0;name=LED 2,2;";
      shape[39] = "func=rect;x=82;y=86;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[40] = "func=rect;x=82;y=88;width=4;height=7;bc=#FF0000;pw=0;name=LED 2,3;";
      shape[41] = "func=rect;x=82;y=99;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[42] = "func=rect;x=82;y=101;width=4;height=7;bc=#FF0000;pw=0;name=LED 2,4;";
      shape[43] = "func=rect;x=95;y=47;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[44] = "func=rect;x=95;y=49;width=4;height=7;bc=#FF0000;pw=0;name=LED 3,0;";
      shape[45] = "func=rect;x=95;y=60;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[46] = "func=rect;x=95;y=62;width=4;height=7;bc=#FF0000;pw=0;name=LED 3,1;";
      shape[47] = "func=rect;x=95;y=73;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[48] = "func=rect;x=95;y=75;width=4;height=7;bc=#FF0000;pw=0;name=LED 3,2;";
      shape[49] = "func=rect;x=95;y=86;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[50] = "func=rect;x=95;y=88;width=4;height=7;bc=#FF0000;pw=0;name=LED 3,3;";
      shape[51] = "func=rect;x=95;y=99;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[52] = "func=rect;x=95;y=101;width=4;height=7;bc=#FF0000;pw=0;name=LED 3,4;";
      shape[53] = "func=rect;x=108;y=47;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[54] = "func=rect;x=108;y=49;width=4;height=7;bc=#FF0000;pw=0;name=LED 4,0;";
      shape[55] = "func=rect;x=108;y=60;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[56] = "func=rect;x=108;y=62;width=4;height=7;bc=#FF0000;pw=0;name=LED 4,1;";
      shape[57] = "func=rect;x=108;y=73;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[58] = "func=rect;x=108;y=75;width=4;height=7;bc=#FF0000;pw=0;name=LED 4,2;";
      shape[59] = "func=rect;x=108;y=86;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[60] = "func=rect;x=108;y=88;width=4;height=7;bc=#FF0000;pw=0;name=LED 4,3;";
      shape[61] = "func=rect;x=108;y=99;width=4;height=11;bc=#666666;pw=0;name=LED;";
      shape[62] = "func=rect;x=108;y=101;width=4;height=7;bc=#FF0000;pw=0;name=LED 4,4;";
      shape[63] = "func=rect;x=6;y=60;width=18;height=18;bc=#808080;pw=0;name=button A;";
      shape[64] = "func=ell;x=10;y=64;width=10;height=10;bc=#000000;pw=0;name=button A;";
      shape[65] = "func=rect;x=142;y=60;width=18;height=18;bc=#808080;pw=0;name=button B;";
      shape[66] = "func=ell;x=146;y=64;width=10;height=10;bc=#000000;pw=0;name=button B;";
      shape[67] = "func=rect;x=0;y=130;width=166;height=8;bc=#006666;pw=0;name=bottom;";
      shape[68] = "func=rect;x=8;y=138;width=150;height=8;bc=#006666;pw=0;name=bottom;";
      shape[69] = "func=ell;x=0;y=130;width=16;height=16;bc=#006666;pw=0;name=corner;";
      shape[70] = "func=ell;x=150;y=130;width=16;height=16;bc=#006666;pw=0;name=corner;";
      shape[71] = "func=rect;x=0;y=118;width=6;height=12;bc=#006666;pw=0;name=gap;";
      shape[72] = "func=rect;x=17;y=118;width=22;height=12;bc=#006666;pw=0;name=gap;";
      shape[73] = "func=rect;x=50;y=118;width=27;height=12;bc=#006666;pw=0;name=gap;";
      shape[74] = "func=rect;x=88;y=118;width=27;height=12;bc=#006666;pw=0;name=gap;";
      shape[75] = "func=rect;x=126;y=118;width=22;height=12;bc=#006666;pw=0;name=gap;";
      shape[76] = "func=rect;x=160;y=118;width=6;height=12;bc=#006666;pw=0;name=gap;";
      shape[77] = "func=ell;x=3;y=114;width=18;height=18;bc=Transparent;pc=#BFA95A;pw=4;";
      shape[78] = "func=rect;x=6;y=128;width=11;height=18;bc=#BFA95A;pw=0;name=port 0;";
      shape[79] = "func=ell;x=36;y=114;width=18;height=18;bc=Transparent;pc=#BFA95A;pw=4;";
      shape[80] = "func=rect;x=39;y=128;width=11;height=18;bc=#BFA95A;pw=0;name=port 1;";
      shape[81] = "func=ell;x=74;y=114;width=18;height=18;bc=Transparent;pc=#BFA95A;pw=4;";
      shape[82] = "func=rect;x=77;y=128;width=11;height=18;bc=#BFA95A;pw=0;name=port 2;";
      shape[83] = "func=ell;x=112;y=114;width=18;height=18;bc=Transparent;pc=#BFA95A;pw=4;";
      shape[84] = "func=rect;x=115;y=128;width=11;height=18;bc=#BFA95A;pw=0;name=port 3V;";
      shape[85] = "func=ell;x=145;y=114;width=18;height=18;bc=Transparent;pc=#BFA95A;pw=4;";
      shape[86] = "func=rect;x=148;y=128;width=11;height=18;bc=#BFA95A;pw=0;name=port GND;";
      shape[87] = "func=text;x=12;y=40;text=A;fs=12;fn=Trebuchet MS;bc=#FFFFFF;";
      shape[88] = "func=text;x=148;y=40;text=B;fs=12;fn=Trebuchet MS;bc=#FFFFFF;";
      shape[89] = "func=text;x=10;y=134;text=0;fs=6;fn=Trebuchet MS;bc=#000000;";
      shape[90] = "func=text;x=43;y=134;text=1;fs=6;fn=Trebuchet MS;bc=#000000;";
      shape[91] = "func=text;x=81;y=134;text=2;fs=6;fn=Trebuchet MS;bc=#000000;";
      shape[92] = "func=text;x=117;y=134;text=3V;fs=6;fn=Trebuchet MS;bc=#000000;";
      shape[93] = "func=text;x=148;y=134;text=GND;fs=6;fn=Trebuchet MS;bc=#000000;";
      shape[94] = "func=rect;x=1;y=130;width=3;height=13;bc=#BFA95A;pw=0;";
      shape[95] = "func=rect;x=19;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[96] = "func=rect;x=24;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[97] = "func=rect;x=29;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[98] = "func=rect;x=34;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[99] = "func=rect;x=52;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[100] = "func=rect;x=57;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[101] = "func=rect;x=62;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[102] = "func=rect;x=67;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[103] = "func=rect;x=72;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[104] = "func=rect;x=90;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[105] = "func=rect;x=95;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[106] = "func=rect;x=100;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[107] = "func=rect;x=105;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[108] = "func=rect;x=110;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[109] = "func=rect;x=128;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[110] = "func=rect;x=133;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[111] = "func=rect;x=138;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[112] = "func=rect;x=143;y=130;width=3;height=16;bc=#BFA95A;pw=0;";
      shape[113] = "func=rect;x=161;y=130;width=3;height=13;bc=#BFA95A;pw=0;";
      shape[114] = "func=tri;x=0.879;y=142.379;x1=2.121;y1=0;x2=0;y2=2.121;x3=4.242;y3=2.121;bc=#BFA95A;pw=0;angle=45;";
      shape[115] = "func=tri;x=159.879;y=142.379;x1=2.121;y1=0;x2=0;y2=2.121;x3=4.242;y3=2.121;bc=#BFA95A;pw=0;angle=-45;";
    }
    
    public void Shapes_Add(int shX, int shY, int iMin, int iMax){
      
      Shapes_CalcWidthAndHeight(iMin, iMax);
    
      double s = scale;
      for (int i = iMin;i<= iMax; i++){
        Primitive shp = shape[i];
        GraphicsWindow.PenWidth = shp["pw"] * s;
        if (shp["pw"] > 0 ){
          GraphicsWindow.PenColor = shp["pc"];
        }
        if (Text.IsSubText("rect|ell|tri|text", shp["func"]) ){
          GraphicsWindow.BrushColor = shp["bc"];
        }
        int ccp=Text.GetCharacterCode( Text.GetSubText(shp["func"],1,1));
        char cc=Convert.ToChar(ccp);
       //  GraphicsWindow.Title=ccp;
        switch ((char)cc){
        case 'r':
          shp["obj"] = Shapes.AddRectangle(shp["width"] * s, shp["height"] * s);
         
          break;
        case  'e':
          shp["obj"] = Shapes.AddEllipse(shp["width"] * s, shp["height"] * s);
          break;
        case  't':
          shp["obj"] = Shapes.AddTriangle(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s, shp["x3"] * s, shp["y3"] * s);
          break;
        case 'l':
          shp["obj"] = Shapes.AddLine(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s);
          break;
        case 'x':
          
          Primitive fs = shp["fs"];
          
          GraphicsWindow.FontSize = fs * s;
          GraphicsWindow.FontName = shp["fn"];
          shp["obj"] = Shapes.AddText(shp["text"]);
          break;
        }
        
        int x = shp["x"];
        int y = shp["y"];
        shp["rx"] = x;
        shp["ry"] = y;
        
        Shapes.Move(shp["obj"], shX + x * s, shY + y * s);
        if (Text.IsSubText("rect|ell|tri|text", shp["func"]) && (shp["angle"] != 0) && (shp["angle"] != "") )
          Shapes.Rotate(shp["obj"], shp["angle"]);
        
        shape[i] = shp;
      }
      
    }
    
    public void Shapes_CalcWidthAndHeight(int iMin, int iMax){
        int xmin=0;
        int xmax=0;
        int ymin=0;
        int ymax=0;
    
      for (int i = iMin;i<= iMax; i++){
        Primitive shp = shape[i];
        if ((shp["func"] == "tri") || (shp["func"] == "line" )){
          xmin = shp["x1"];
          xmax = shp["x1"];
          ymin = shp["y1"];
          ymax = shp["y1"];
          if (shp["x2"] < xmin ){
            xmin = shp["x2"];
          };
          if (xmax < shp["x2"] ){
            xmax = shp["x2"];
          };
          if (shp["y2"] < ymin ){
            ymin = shp["y2"];
          };
          if (ymax < shp["y2"] ){
            ymax = shp["y2"];
          };
          if (shp["func"] = "tri" ){
            if (shp["x3"] < xmin ){
              xmin = shp["x3"];
            };
            if (xmax < shp["x3"] ){
              xmax = shp["x3"];
            };
            if (shp["y3"] < ymin ){
              ymin = shp["y3"];
            };
            if (ymax < shp["y3"] ){
              ymax = shp["y3"];
            };
          };
          shp["width"] = xmax - xmin;
          shp["height"] = ymax - ymin;
        }
    
        if (i == 1 ){
          shWidth = shp["x"] + shp["width"];
          shHeight = shp["y"] + shp["height"];}
        else{
          if (shWidth < shp["x"] + shp["width"] )
            shWidth = shp["x"] + shp["width"];
          
          if (shHeight < shp["y"] + shp["height"] )
            shHeight = shp["y"] + shp["height"];
          
        }
        shape[i] = shp;
      }
    }

    Wednesday, September 6, 2017 6:53 AM
  • to run:

    • open xamarin worksheets
    • add package smallbasic worksheet 1.2
    • paste upper code into xamarin sheet
    • run (ctrl+enter)

    warnings & notes

    • xamarin worksheet has some nasty bugs:
    • save doesn't work 
    • sb window is sometimes hidden so click at taskbar to show it
    • sometimes it won't start or run, then close the WPF agent window
    • sometimes it states strange errors, just close it and restart xamarin
    • always add package prior to use smallbasic
    • paste the code in same block with #r statement, just press shift+enter and then paste
    • Edited by Tryhest Wednesday, September 6, 2017 7:19 AM
    Wednesday, September 6, 2017 6:56 AM
  • to run:

    • open xamarin worksheets
    • add package smallbasic worksheet 1.2
    • paste upper code into xamarin sheet
    • run (ctrl+enter)

    warnings & notes

    • xamarin worksheet has some nasty bugs:
    • save doesn't work 
    • sb window is sometimes hidden so click at taskbar to show it
    • sometimes it won't start or run, then close the WPF agent window
    • sometimes it states strange errors, just close it and restart xamarin
    • always add package prior to use smallbasic
    • paste the code in same block with #r statement, just press shift+enter and then paste

    Tryhest, cool!


    Nonki Takahashi

    Wednesday, September 6, 2017 10:38 PM
    Moderator
  • Additional Information:


    Nonki Takahashi

    Thursday, September 7, 2017 1:06 PM
    Moderator
  • I made a thread for Xamarin Workbooks.

    Small Basic Sample Code for Xamarin Workbooks


    Nonki Takahashi

    Thursday, September 7, 2017 1:23 PM
    Moderator
  • I posted this related blog post: https://blogs.msdn.microsoft.com/smallbasic/2017/08/28/play-with-microbit-and-small-basic/

    Ed Price, Azure Development Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)

    Answer an interesting question? Create a wiki article about it!

    Friday, September 15, 2017 11:23 PM
    Owner
  • This is a game using micro:bit as a controller: QZN342-6.

    Micro:bit program is switch.

    Screen shot of a program Turtle Dodger 0.7b


    Nonki Takahashi

    I wrote a TechNet Wiki article about this program.

    Small Basic: How to Use micro:bit


    Nonki Takahashi

    Sunday, October 8, 2017 10:29 AM
    Moderator
  • I posted this related blog post: https://blogs.msdn.microsoft.com/smallbasic/2017/08/28/play-with-microbit-and-small-basic/

    Ed Price, Azure Development Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)

    Answer an interesting question? Create a wiki article about it!


    The link might be https://blogs.msdn.microsoft.com/smallbasic/2017/09/13/small-basic-microbit/?

    Nonki Takahashi

    Sunday, October 8, 2017 10:32 AM
    Moderator
  • MakeCode for micro:bit BETA has been uploaded on Windows Store.

    No longer needed to select MICROBIT drive when Download program to micro:bit with this new app.


    Nonki Takahashi

    Monday, January 29, 2018 1:25 AM
    Moderator
  • microbit project dice: 

    shake to throw dice

    https://makecode.microbit.org/_fqeAUocEgA8D

    Friday, March 23, 2018 5:51 PM
  • random plot bars:

    basic.forever(() => {
        led.plotBarGraph(
        Math.random(41),
        40
        )
        basic.pause(88)
    })

    Friday, March 23, 2018 6:25 PM
  • I rewrote the graphics program for micro:bit above (GMT047-1).  Try to click A or B button.

    Screen shot of a program micro:bit 0.3


    Nonki Takahashi

    Monday, April 29, 2019 10:08 AM
    Moderator
  • I wrote a program to control a robot!

    TAMIYA CAM-PROGRAM ROBOT

    Video:

    How to make:

    Using:

    Programs:

    • Small Basic Robot Control Program WMF008-1 (for PC)
    • send - Microsoft MakeCode (for controller)
    • receive - Microsoft MakeCode (for robot)

    Nonki Takahashi




    Monday, May 6, 2019 8:25 AM
    Moderator
  • updt to robot : NJK632

    • added turtle 
    • colors changed

    Thursday, May 28, 2020 7:29 PM
  • I wrote a program to control a robot!

    TAMIYA CAM-PROGRAM ROBOT

    Video:

    How to make:

    Using:

    Programs:

    • Small Basic Robot Control Program WMF008-1 (for PC)
    • send - Microsoft MakeCode (for controller)
    • receive - Microsoft MakeCode (for robot)

    Nonki Takahashi




    if u mount a pen on robot, then it becomes a nice plotter!
    Friday, May 29, 2020 9:47 AM
  • added loops and dist control: TCP708

    Friday, May 29, 2020 10:14 AM
  • added preset shapes: TCP708-1

    Saturday, May 30, 2020 5:10 AM
  • added complex tetris-like path for nonki's robot: ZFD646

    Monday, June 1, 2020 11:50 AM
  • dear nonki, try to plot the pattern with ur robot,adjust size to fit ur paper size, the size 5 is set to fit screen
    Tuesday, June 2, 2020 4:53 PM
  • added test letters: LWL219

    Tuesday, June 2, 2020 5:37 PM
  • Hey Trihest – Congratulations ! It’s a marvelous headache problem. (en Français un problème casse-tête) Nonki will appreciate and perhaps create a program to find a solution.  I am hoping the readers will take their jigsaws to create  this blocks puzzle also known as the tetris-problem and try to put the pieces back to their location.

    Just imagine back at the end of the seventies. I thought, a Japanese mathematician, presented a list of pieces, asking to find the solution with a computer, to put the pieces back in the box ! I think basically the problem was known as the tetris problem. Imagine that you have to cut pieces out of a  sheet. The profit is not determined by the number of pieces but mainly by what you are losing  from the sheet. We just received an HP85 (16 Ko of memory) and the question from someone of the labs from a boatyard was to find out if it  was also possible to calculate such solutions with a technical desktop computer using the HP-Technical-Basic. The computer was running two days and found not only the mirrored solutions but also another one for the japanese problem ! The japanese was sending us a copy of  the solution in the original wooden box ! Today it is still a major programming challenge.

    an "easy example" :  

    https://happy44.com/wooden-building-blocks-puzzle-toy-game-wooden-puzzle-educational-intelligence-box/


    • Edited by Eddy Abts Tuesday, June 2, 2020 6:17 PM
    Tuesday, June 2, 2020 6:13 PM
  • robot maze-solver: LWL219-1

    maze-image:

    to print, maze image must be edited image with inkscape to adjust cells to robot size (several A4 needed to print or A3/A2 papers) cca.size 60x120 cm
    • Edited by Tryhest Tuesday, June 2, 2020 7:30 PM
    Tuesday, June 2, 2020 7:24 PM
  • final setup simulation:

    u must adjust also robot scaling to fit image cells size

    • Edited by Tryhest Tuesday, June 2, 2020 7:48 PM
    Tuesday, June 2, 2020 7:45 PM
  • Hey Trihest – Congratulations ! It’s a marvelous headache problem. (en Français un problème casse-tête) Nonki will appreciate and perhaps create a program to find a solution.  I am hoping the readers will take their jigsaws to create  this blocks puzzle also known as the tetris-problem and try to put the pieces back to their location.

    Just imagine back at the end of the seventies. I thought, a Japanese mathematician, presented a list of pieces, asking to find the solution with a computer, to put the pieces back in the box ! I think basically the problem was known as the tetris problem. Imagine that you have to cut pieces out of a  sheet. The profit is not determined by the number of pieces but mainly by what you are losing  from the sheet. We just received an HP85 (16 Ko of memory) and the question from someone of the labs from a boatyard was to find out if it  was also possible to calculate such solutions with a technical desktop computer using the HP-Technical-Basic. The computer was running two days and found not only the mirrored solutions but also another one for the japanese problem ! The japanese was sending us a copy of  the solution in the original wooden box ! Today it is still a major programming challenge.

    an "easy example" :  

    https://happy44.com/wooden-building-blocks-puzzle-toy-game-wooden-puzzle-educational-intelligence-box/


    it's not an easy task to create such boxes, it needs a deep ai algorithm 
    Wednesday, June 3, 2020 3:00 AM