Shop OBEX P1 Docs P2 Docs Learn Events
Open Propeller Project #5: BlocklyProp - Page 8 — Parallax Forums

Open Propeller Project #5: BlocklyProp

1234568

Comments

  • ValeTValeT Posts: 308
    edited 2014-11-10 17:02
    Mr. Gracey,

    Does Parallax have a road map for BlocklyProp we should be following? I am asking because right now I am just adding random blocks without much of a plan.
  • ValeTValeT Posts: 308
    edited 2014-11-11 08:05
    Michael L,

    How do I add global variables? I know that to add variables inside methods you use setups, but I can't seem to figure out how to add global variables.

    For example, all of the cogs that are declared should be declared as global integers allowing other methods to stop the cogs under certain conditions.
  • Michel LMichel L Posts: 141
    edited 2014-11-11 09:34
    ValeT wrote: »
    Michael L,

    How do I add global variables? I know that to add variables inside methods you use setups, but I can't seem to figure out how to add global variables.

    For example, all of the cogs that are declared should be declared as global integers allowing other methods to stop the cogs under certain conditions.

    ValeT,

    For reference: the code is:
    int *cog = cog_run(&method, 10);

    If you declare a variable it will always be global. Blockly has no support for local variables. Because you need a pointer (I think by seeing the star in the command), you can't use the current variable system.
    But you're in luck, I've been extending Blockly so that you will be able to use those in the future.

    If you can wait a little while until I can test it thouroughly I'll check it in. Then you'll be able to extend it to use for cog_run.

    Michel

    ps: please spell my name correctly. There's no 'a' in my first name.
  • ValeTValeT Posts: 308
    edited 2014-11-11 09:52
    Michel L wrote: »
    ValeT,

    For reference: the code is:
    int *cog = cog_run(&method, 10);

    If you declare a variable it will always be global. Blockly has no support for local variables. Because you need a pointer (I think by seeing the star in the command), you can't use the current variable system.
    But you're in luck, I've been extending Blockly so that you will be able to use those in the future.

    If you can wait a little while until I can test it thouroughly I'll check it in. Then you'll be able to extend it to use for cog_run.

    Michel

    ps: please spell my name correctly. There's no 'a' in my first name.

    Thanks for working on that. Let me know if you need any help.

    Sorry for spelling your name wrong!
  • Michel LMichel L Posts: 141
    edited 2014-11-11 10:09
    ValeT wrote: »
    Thanks for working on that. Let me know if you need any help.

    Sorry for spelling your name wrong!

    ValeT,

    I'm already happy that someone's helping to create blocks. It's not really a hard job (I hope to once automate that partly) but there's a lot to do.

    It permits me to focus on the larger parts. I'll get back to the way a project is created once I've finished the pointers.
    Blocks will then be categorized and will only be available if the category is selected in the project. This way the list of blocks will be limited to what the user actually wants to use, improving toolbox overview.

    Michel
  • ValeTValeT Posts: 308
    edited 2014-11-12 15:00
    Michel L wrote: »
    ValeT,

    I'm already happy that someone's helping to create blocks. It's not really a hard job (I hope to once automate that partly) but there's a lot to do.

    It permits me to focus on the larger parts. I'll get back to the way a project is created once I've finished the pointers.
    Blocks will then be categorized and will only be available if the category is selected in the project. This way the list of blocks will be limited to what the user actually wants to use, improving toolbox overview.

    Michel

    That sounds like a great idea! Its going to be needed; the Sensors tab will be huge by the time I am finished with it :)
  • ValeTValeT Posts: 308
    edited 2014-11-16 06:14
    Michel L,

    I am not sure I understand what the Blockly.ORDER_ATOMIC statement does when you are returning the code. Can you please give me a brief explanation? Thanks and sorry for the confusion.
  • Michel LMichel L Posts: 141
    edited 2014-11-16 10:23
    ValeT wrote: »
    Michel L,

    I am not sure I understand what the Blockly.ORDER_ATOMIC statement does when you are returning the code. Can you please give me a brief explanation? Thanks and sorry for the confusion.

    ValeT,

    When adding, dividing,... a certain order is used by the processor (as in regular math expressions) to execute the line. A multiply will be executed before a summation. While braces override everything.
    Depending on the order you return with your code Blockly will add braces to make sure the order stays correct.

    This is mainly important when writing the commands for adding, dividing,... Atomic is the smallest possible unit that can never be split up, so Blockly will not put braces around it. If you would use other levels, it might happen it adds them while its unnecessary.

    The possible orders (as defined in propc.js):
    Blockly.propc.ORDER_ATOMIC = 0;         // 0 "" ...
    Blockly.propc.ORDER_UNARY_POSTFIX = 1;  // expr++ expr-- () [] .
    Blockly.propc.ORDER_UNARY_PREFIX = 2;   // -expr !expr ~expr ++expr --expr
    Blockly.propc.ORDER_MULTIPLICATIVE = 3; // * / % ~/
    Blockly.propc.ORDER_ADDITIVE = 4;       // + -
    Blockly.propc.ORDER_SHIFT = 5;          // << >>
    Blockly.propc.ORDER_RELATIONAL = 7;     // is is! >= > <= <
    Blockly.propc.ORDER_EQUALITY = 8;       // == != === !==
    Blockly.propc.ORDER_BITWISE_AND = 9;    // &
    Blockly.propc.ORDER_BITWISE_XOR = 10;    // ^
    Blockly.propc.ORDER_BITWISE_OR = 11;    // |
    Blockly.propc.ORDER_LOGICAL_AND = 12;   // &&
    Blockly.propc.ORDER_LOGICAL_OR = 13;    // ||
    Blockly.propc.ORDER_CONDITIONAL = 14;   // expr ? expr : expr
    Blockly.propc.ORDER_ASSIGNMENT = 15;    // := *= /= ~/= %= += -= <<= >>= &= ^= |=
    Blockly.propc.ORDER_NONE = 99;          // (...)
    

    The numeric value is what Blockly uses to determine the level. A lower number has a higher priority.

    I hope this clears things up.


    Something on the side:
    With the latest build of BlocklyProp the Blockly C version wouldn't load. This was because in framec.html you referred to debug_lcd.js while you called the file debug_LCD.js.
    It works on your computer (an mine) as we develop using Windows. Unlike Linux (what the server runs on where BlocklyProp is hosted), Windows is case insensitive.

    Please to remember to write your code case sensitive.
    Thank you

    Michel
  • ValeTValeT Posts: 308
    edited 2014-11-16 14:04
    Michel L,

    Thanks for the explanation. I believe that I understand when I need to use it and when not to.

    Sorry, about the spelling error; I have corrected it and made sure that none of my other additions have that mistake in them. Thanks for alerting me of this, I will try not to do it again
  • ValeTValeT Posts: 308
    edited 2014-11-17 13:52
    Michel L,

    Quick question. I have almost completed adding all of the sensors that have C code documentation on Parallax's website to BlocklyProp. For the sensors that don't have C code documentation, should we just ignore them right now or should I experiment with them and then add what I can come up with to Blockly?

    Thanks.
  • Michel LMichel L Posts: 141
    edited 2014-11-23 04:55
    ValeT wrote: »
    Michel L,

    Quick question. I have almost completed adding all of the sensors that have C code documentation on Parallax's website to BlocklyProp. For the sensors that don't have C code documentation, should we just ignore them right now or should I experiment with them and then add what I can come up with to Blockly?

    Thanks.

    ValeT,

    I think we should add blocks for sensors, chips and actuators that are not in the original C code documentation. Just be sure everything works.

    But I think we should add a bit more Spin blocks before doing that. There was a request to prioritize the C blocks a bit, but I would like to go to a more even progression of both editor.


    Thanks for the help,

    Michel
  • ValeTValeT Posts: 308
    edited 2014-11-23 17:04
    Michel L wrote: »
    ValeT,

    I think we should add blocks for sensors, chips and actuators that are not in the original C code documentation. Just be sure everything works.

    But I think we should add a bit more Spin blocks before doing that. There was a request to prioritize the C blocks a bit, but I would like to go to a more even progression of both editor.


    Thanks for the help,

    Michel

    Sounds like a plan.

    Right now, I am in the works adding a number of Spin blocks but am having a little trouble with the Spin code since I have never used Spin before. It will just take me a little more time to get them correct.

    On a side note, the project creation windows are looking great!
  • Michel LMichel L Posts: 141
    edited 2014-11-25 11:59
    ValeT wrote: »
    Sounds like a plan.

    Right now, I am in the works adding a number of Spin blocks but am having a little trouble with the Spin code since I have never used Spin before. It will just take me a little more time to get them correct.

    On a side note, the project creation windows are looking great!


    Thanks, It's far from done, but changing to a wizard format is needed to have space for the new features.
  • ValeTValeT Posts: 308
    edited 2014-11-27 10:24
    Michel L wrote: »
    Thanks, It's far from done, but changing to a wizard format is needed to have space for the new features.

    Definitely. What is your plan for selecting features? I am wondering because it could get very confusing if you have a ton of different options.

    Have a great Thanksgiving!
  • Michel LMichel L Posts: 141
    edited 2014-11-27 10:38
    ValeT wrote: »
    Definitely. What is your plan for selecting features? I am wondering because it could get very confusing if you have a ton of different options.

    Have a great Thanksgiving!

    The first thing I want to implement is the categories of blocks. So that the user can choose what sensors they want to use without having a toolbox that's to big.

    Sadly no Thanksgiving over here, but a great Thanksgiving to you all!

    Michel
  • ValeTValeT Posts: 308
    edited 2014-11-27 11:55
    Michel L wrote: »
    The first thing I want to implement is the categories of blocks. So that the user can choose what sensors they want to use without having a toolbox that's to big.

    Sadly no Thanksgiving over here, but a great Thanksgiving to you all!

    Michel

    Sorry; I forgot you were in Belgium.

    If you want, I can work on adding the choice boxes/dialogs in the window. If you give me an example, I will be able to figure it out and copy/extend it to other blocks.

    Thanks,
    ValeT
  • Michel LMichel L Posts: 141
    edited 2014-11-27 13:38
    ValeT wrote: »
    Sorry; I forgot you were in Belgium.

    If you want, I can work on adding the choice boxes/dialogs in the window. If you give me an example, I will be able to figure it out and copy/extend it to other blocks.

    Thanks,
    ValeT

    ValeT,

    I don't just want to add a new checkbox each time we add a new block. So I'm still figuring out how to to do it in a generic way. It won't change anything to the definition of the blocks, it'll just change the "keepers" variable in the frameX.html file.
    And I'll also need to create a way of saving it into the projects.

    Also I noticed that the project dialog is still not 100%, it still sometimes blocks the browser. So I'll have to investigate that further before I continue to add new features.

    Michel
  • ValeTValeT Posts: 308
    edited 2014-12-16 11:27
    It's been a pretty long time since this thread has been updated, and so I would like to make a small progress report. Since the last post, we have added a large number of new blocks. The current compatibility list is below.

    If possible, we need some people to test the system and open issues if anything is wrong ( link for issues area on Github: https://github.com/parallaxinc/BlocklyProp/issues ).

    Current compatibility list for sensors and hardware:
    Propeller C
    - PIR Sensor ( all Parallax PIR Sensors )
    - Mutli-Cog ( start )
    - Digital and Analog I/O support
    - Serial connection ( initialize, transmit, receive )
    - Freqout command
    - Joystick
    - Ping))) sensor
    - Abdrive
    - LCD ( currently, only 1 LCD can be attached )
    - Servo
    - MX2125 Acceleration sensor
    - MMA7455 Acceleration sensor
    - SF02 Laser Rangefinder
    - Etape liquid sensor

    Spin
    - Ping))) sensor
    - Digital and Analog I/O support
    - Multi-Cog
    - Serial connection ( initialize, transmit, receive )
    - SF02 Laser Rangefinder
    - Joystick
    - MMA7455 Acceleration sensor
    - Etape liquid sensor
    - PIR Sensor
    - Freqout command
    - LCD ( currently, only 1 LCD can be attached )
    - Servo
    - Abdrive
  • JCeeJCee Posts: 36
    edited 2015-03-02 20:21
    I really like where the BlockyProp visual programming is heading, but when I tried it on my Activity Board it couldnt get it to compile. Am I a little to early to the party? I get "BlocklyPropClient not available" is there a step I'm missing.
  • ValeTValeT Posts: 308
    edited 2015-03-03 17:55
    JCee wrote: »
    I really like where the BlockyProp visual programming is heading, but when I tried it on my Activity Board it couldnt get it to compile. Am I a little to early to the party? I get "BlocklyPropClient not available" is there a step I'm missing.

    Hi JCee,

    Have you downloaded and installed the BlocklyPropClient yet? If not, you will need to download it and run the python script. Here is the link to the Github page: https://github.com/parallaxinc/BlocklyPropClient. On the right hand side of the page, you can download the zip file of the repository. Next, navigate to the directory and run 'python BlocklyPropClient.py' in terminal, or command line. This will require python though, and 3 library dependencies that can be installed by running the 'python InstallDependencies.py' script in command line or terminal.

    We are planning to release v1.0 of Blockly and BlocklyPropClient by the end of March. When those are released, a compiled version of the Client will be available for download, so you will not need to do anything to get that setup.

    Let me know if you have any further questions or need additional help,
    ValeT
  • JCeeJCee Posts: 36
    edited 2015-03-04 18:45
    I downloaded the directories and ran the python scripts, but no joy. I guess I will wait a few weeks for the easy setup. Looking forward to the release!
  • ValeTValeT Posts: 308
    edited 2015-03-05 06:22
    JCee wrote: »
    I downloaded the directories and ran the python scripts, but no joy. I guess I will wait a few weeks for the easy setup. Looking forward to the release!

    Ok!

    If you do want to try and get it setup sometime earlier though, just let me know and I can walk you through the setup step by step.
  • Michel LMichel L Posts: 141
    edited 2015-05-20 01:47
    JCee wrote: »
    I downloaded the directories and ran the python scripts, but no joy. I guess I will wait a few weeks for the easy setup. Looking forward to the release!

    Hi JCee,

    what operating system are you using? If it's a 64bit Windows I can provide you with a version within a day or so. For other systems it's a bit harder to get you a build.
    These builds do not require python or any other dependencies.
    For now, it does need the Prop-gcc compiler to be in your path if you want to be able to compile a C program. (The spin compiler is included)

    Michel
  • WhitWhit Posts: 4,191
    edited 2016-07-20 15:17
    I think it is time to revive this thread a bit in light of all the work done by Ken's Interns this summer (See https://www.parallax.com/news/2016-07-19/developing-blockly-propeller-our-team-includes-three-student-interns-who’ve ). Parallax - Is this best place to continue this discussion?

    I started playing around with this in prep for the S3.

    Set up a log-in on BlocklyProp per the link. Reminded myself of my github log in info. Loaded the client.

    Then I used my QuickStart Board and played with the serial terminal. Fun stuff.

    I am having some formatting issue with the old (desktop) and the new browser based serial terminal. For instance - in the browser based version Mitchell's Serial Terminal Code places "13" back on the same line as 10 (but in the 0 postion) - all else works as it should. This does not happen with the old Desktop Parallax Serial Terminal. Any ideas?
  • If you are using Blockly's terminal (console) then you shouldn't have problems - are you trying to use PST with Blockly?
  • WhitWhit Posts: 4,191
    edited 2016-07-20 18:49
    Ken - Saw your other note. Would it be better to sort this sort of issue out somewhere else?

    Whatever you think is best...

    So - here is the issue - If I use the Serial terminal (michell) - see photo,
    Serial%20terminal%20%28michell%29.JPG

    I load to EEPROM to my QuickStart and run in the terminal console, I get the misplace line for "13" - see photo.
    terminal.JPG

    If I run in on the Parallax Serial Terminal (old desktop version), I get a properly formatted list - see photo.
    Parallax%20Serial%20Terminal.JPG
    400 x 363 - 41K
    623 x 534 - 27K
    241 x 420 - 15K
  • WhitWhit Posts: 4,191
    edited 2016-07-20 19:08
    I get similar results with my modified code which prints 1 - 24 slowly in the terminal (so you can watch in work) Placement as above in the console (incorrect) and in the Parallax Serial Terminal (correct). Not sure why the mistake happens in the console serial terminal...
  • Yes, I see the issue now. There are several GitHub issues around the console now and Michel plans on deploying a new version to the Demo site by this weekend.
  • WhitWhit Posts: 4,191
    Ken Gracey wrote: »
    Yes, I see the issue now. There are several GitHub issues around the console now and Michel plans on deploying a new version to the Demo site by this weekend.

    I'll test it out! And keep my eyes on the GitHub issues.

    Thanks!

  • Cluso99Cluso99 Posts: 18,066
    Is this the place to ask Blockly Prop questions?

    I have downloaded the Beta and Ican compile and download.

    But Blockly does not work for me because I am using my P8XBlade2 board which runs at 96MHz (8*12MHz). Can I change the default somewhere?

    What does Blockly compile to (Spin, C to CMM/LMM)?
    Can Blockly use spin or pasm objects?

    I have built an Otto/Zowi/Bob Bot with my grandsons. It runs with an Arduino and I thought it might be good to get them interested in programming the Bot with Blockly and the Propeller.
Sign In or Register to comment.