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

Open Propeller Project #5: BlocklyProp

1234689

Comments

  • ValeTValeT Posts: 308
    edited 2014-10-19 04:54
    FredBlais wrote: »
    For me, one of the strengths of the Propeller/Spin language is the level of abstraction that the objects provides. There is so much drivers you can find on the Obex so you dont have to always reinvent the wheel with complicated stuff like video generation and SD card routines etc...

    Graphical programming like Blockly helps a lot non-programmer and young people to be able to make something work quickly, it`s just so intuitive. Give them great "blocks" and making cool stuff takes a matter of minutes. Just think about the success of Lego Mindstorms in robotics.

    I hope an IDE like this is something that is going to be shipped with Parallax Robots to make them intelligible for everyone.

    That would be great.

    There are so many people who are new to this kind of stuff and get confused when they see lots of code. This would definitely help those who are new to programming and hardware get into the propeller more easily.
  • ValeTValeT Posts: 308
    edited 2014-10-19 14:22
    I have gotten a small error.....

    When I tried to first run the application, I get the following error:

    Do you know what I am doing wrong?

    I have downloaded the Github files, and blocklyprop.bat I the program that is throwing the errors.

    Thanks for the help,
    ValeT
    826 x 84 - 5K
  • ValeTValeT Posts: 308
    edited 2014-10-19 15:38
    After some debugging, I was able to get a version of it to work.

    I built the whole source package using Netbeans, and it compiles without any errors. When I try to run the built jar file, named BlocklyProp-1.0-SNAPSHOT, it gives me a NoClassDefFoundError: org/eclipse/jetty/server/connector.

    The thing is though, when I run BlocklyProp.java in Netbeans, it runs just fine!

    Any ideas?
  • ValeTValeT Posts: 308
    edited 2014-10-28 13:23
    Okay. Everything works, so you can disregard my previous post.

    I have written my own block, but when I run Blockly, it does not show up. What code do I need to add/change to create my own block? I don't need any actual code, I just need a file location for where I would go to have my block added so that it appeared when I run the program.

    Thanks, and sorry for such a stupid question :)
  • Michel LMichel L Posts: 141
    edited 2014-10-28 14:25
    ValeT,

    I had to let the project rest for a while partly because working on it every day, 40 day's in a row, makes that you lose perspective.
    And also, at my job I need to code JavaScript all day since a couple months, making me want to do something else at home + adding the pressure from deadlines.

    I'll check the project out tomorrow (I had to format my hd since the last time I worked on it). Then I can introduce you to the project.

    Any help is welcome, thanks.

    Michel
  • Michel LMichel L Posts: 141
    edited 2014-10-28 14:51
    ValeT wrote: »
    Okay. Everything works, so you can disregard my previous post.

    I have written my own block, but when I run Blockly, it does not show up. What code do I need to add/change to create my own block? I don't need any actual code, I just need a file location for where I would go to have my block added so that it appeared when I run the program.

    Thanks, and sorry for such a stupid question :)

    A quick answer using my tablet.

    You need to include the file with your Block into the frame, for spin: https://github.com/michel-cf/BlocklyProp/blob/master/webcontent/frame.html

    And then also add the name of your block to the keepers variable in the same file.

    I hope this gets you on the way until I can create a howto.

    Michel
  • ValeTValeT Posts: 308
    edited 2014-10-28 14:58
    Thanks!

    I will try to take a stab at it tonight, and if not then, tomorrow in school. I am going to spend as much time as possible working/helping on this. I will have to balance building a Telepresence device ( with Parallax parts of course ) and working on this though.

    Really appreciate the response so fast,
    ValeT
  • ValeTValeT Posts: 308
    edited 2014-10-29 06:31
    Michael L,

    I attempted to test my code, but it seems I broke the interface :)

    Below is my code. I know it is useless, but I want to create something that is simple and can be expanded upon as I learn more.

    Would you mind taking a look at it?
    'use strict';
    
    
    
    
    if ( !Blockly.Language )
      Blockly.Language = {};
    
    
    
    
    //Joystick block
    Blockly.Language.joystick_input = {
      category: 'Sensors',
      help_url: '',
      init: function() {
        this.setColour( 210 );
        this.appendDummyInput( "" )
          .appendTitle( "Joystick" )
          .appendTitle( "A/D PIN#" )
          .appendTitle( new Blockly.FieldDropdown( [["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"]] ), "PIN" )
        this.setPreviousStatement( true, null )
        this.setNextStatement( true, null )
      }
    };
    
    
    
    
    //Define generators
    Blockly.propc = Blockly.Generator.get( 'propc' );
    
    
    Blockly.propc.joystick_input = funtion() {
      return '';
    };
    

    Thanks.
  • Michel LMichel L Posts: 141
    edited 2014-10-29 14:41
    ValeT,

    I checked it out, and the only major mistake is a simple spelling mistake: function has a c (not funtion)
    Blockly.propc.joystick_input = function() {
      return '';
    };
    

    Other small mistakes that do not break the application:
    help_url -> helpUrl
    And also: each statement in the init function needs to end with a ;
    //Joystick block
    Blockly.Language.joystick_input = {
      category: 'Sensors',
      helpUrl: '',
      init: function() {
        this.setColour( 210 );
        this.appendDummyInput( "" )
          .appendTitle( "Joystick" )
          .appendTitle( "A/D PIN#" )
          .appendTitle( new Blockly.FieldDropdown( [["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"]] ), "PIN" );
        this.setPreviousStatement( true, null );
        this.setNextStatement( true, null );
      }
    };
    

    I usually create new blocks with copy paste, and then changing as required.

    With these changes everything worked on my computer. If it still doesn't work it's probably due to what you added to framec.html

    Michel
  • ValeTValeT Posts: 308
    edited 2014-10-29 14:53
    Michel L wrote: »
    ValeT,

    I checked it out, and the only major mistake is a simple spelling mistake: function has a c (not funtion)
    Blockly.propc.joystick_input = function() {
      return '';
    };
    

    Other small mistakes that do not break the application:
    help_url -> helpUrl
    And also: each statement in the init function needs to end with a ;
    //Joystick block
    Blockly.Language.joystick_input = {
      category: 'Sensors',
      helpUrl: '',
      init: function() {
        this.setColour( 210 );
        this.appendDummyInput( "" )
          .appendTitle( "Joystick" )
          .appendTitle( "A/D PIN#" )
          .appendTitle( new Blockly.FieldDropdown( [["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"]] ), "PIN" );
        this.setPreviousStatement( true, null );
        this.setNextStatement( true, null );
      }
    };
    

    I usually create new blocks with copy paste, and then changing as required.

    With these changes everything worked on my computer. If it still doesn't work it's probably due to what you added to framec.html

    Michel

    Thanks. I have made the changes and will test that later tonight.

    Whenever possible, I am ready for that introduction you said you'd give me :)
  • Michel LMichel L Posts: 141
    edited 2014-10-30 14:14
    As promised I started creating some technical help pages. I've put them in the Github wiki for now.

    To get back into things, I added the freqout Prop-C command.

    Before the summer my enthusiasm dropped because I kept writing on the general interface (mainly php, which I don't like).
    I noticed that to keep it up variation and external input are the most important things. Feature requests, tips,... Please let the comments come.

    Michel
  • Heater.Heater. Posts: 21,230
    edited 2014-10-30 14:18
    Why torture yourself with PHP?

    Javascript and Node.js are here to make life pleasant on the server.
  • Michel LMichel L Posts: 141
    edited 2014-10-30 14:25
    Heater. wrote: »
    Why torture yourself with PHP?

    Javascript and Node.js are here to make life pleasant on the server.

    Sorry, but if I run something other then php on the server, meaning I need a more expensive hosting, I'll go for Java or since shortly Python. I'm just not yet convinced by Node.js.
  • Heater.Heater. Posts: 21,230
    edited 2014-10-30 14:36
    Interesting, I have no idea about why the cost of hosting node would be more than any other language. Node seems to be everywhere, if Microsoft is supporting it.

    Python is cool. Performance is not so hot but that may or may not matter.

    Java is, well, just horrible. Like C++ it is only just now aspiring to features that have been in JS since forever.
  • ValeTValeT Posts: 308
    edited 2014-10-30 14:37
    Heater,

    most of the remaining work, as I understand it, must be completed using Javascript.

    Michael,

    I have tested the test block that I created and everything works fine. Thanks for the help.

    Thanks for the introduction :)! I will try to expand upon it soon.
  • Michel LMichel L Posts: 141
    edited 2014-10-30 14:56
    Heater. wrote: »
    Interesting, I have no idea about why the cost of hosting node would be more than any other language. Node seems to be everywhere, if Microsoft is supporting it.

    Python is cool. Performance is not so hot but that may or may not matter.

    Java is, well, just horrible. Like C++ it is only just now aspiring to features that have been in JS since forever.

    My current hosting is a shared hosting, only supporting php and cgi (never figured out how to get that working though) costing 15€ a year. If I go for a virtual private server on which I can put what I want, its about that a month I believe.

    Lately (the last 6 months) I've been writing an application for my job that uses a lot of json. I've noticed that developing in Python goes a lot faster for this than in Java, but Java is still what I know best and do all day.

    ValeT, It's true that blocks are all Javascript, but the community part that I was expanding is also a lot server side.

    Michel
  • ValeTValeT Posts: 308
    edited 2014-10-30 15:46
    Ok.

    Is there still a lot to do on the community part? Or have you completed most of that already?
  • Michel LMichel L Posts: 141
    edited 2014-10-31 02:36
    ValeT wrote: »
    Ok.

    Is there still a lot to do on the community part? Or have you completed most of that already?

    It's possible to save and load projects, and set it public or private.
    What I wanted to add was a friends system. Friends will see all your projects that you haven't marked as private. Even though they are not public.

    A comments system for projects, where one user can open one from another and leave a comment.

    And what I was doing before I took my summer break was redo the creation of projects. Converting it to a multi-step wizard. This is needed because I want the user to be able to select which blocks he wants to use.
    In a later phase I wanted to add a breadboard builder, where you can design your custom circuit on. So when other want to recreate your project everything needed is included.

    I think this last will add great value to the application as I now often have no idea how to connect some components to my propeller-demo-board.
  • ValeTValeT Posts: 308
    edited 2014-11-01 16:33
    Michel L wrote: »
    It's possible to save and load projects, and set it public or private.
    What I wanted to add was a friends system. Friends will see all your projects that you haven't marked as private. Even though they are not public.

    A comments system for projects, where one user can open one from another and leave a comment.

    And what I was doing before I took my summer break was redo the creation of projects. Converting it to a multi-step wizard. This is needed because I want the user to be able to select which blocks he wants to use.
    In a later phase I wanted to add a breadboard builder, where you can design your custom circuit on. So when other want to recreate your project everything needed is included.

    I think this last will add great value to the application as I now often have no idea how to connect some components to my propeller-demo-board.

    Are you still planning on completing these things? If so, I am not sure I will be much help with that stuff. I am very new to web coding, and will need a lot of catch-up to help on those more complicated projects.
  • Michel LMichel L Posts: 141
    edited 2014-11-02 04:13
    ValeT wrote: »
    Are you still planning on completing these things? If so, I am not sure I will be much help with that stuff. I am very new to web coding, and will need a lot of catch-up to help on those more complicated projects.

    I surely hope so, but if you could help creating blocks that's already work taken out of my hands. You don't have to help on every aspect of the application.
    Thanks
  • ValeTValeT Posts: 308
    edited 2014-11-02 04:58
    Michel L wrote: »
    I surely hope so, but if you could help creating blocks that's already work taken out of my hands. You don't have to help on every aspect of the application.
    Thanks

    Ok, I will focus on adding blocks. In addition, until I get more fluent in web coding and can assist you on the more complicated aspects of the project, I will work on creating tutorials and manuals.
  • Ken GraceyKen Gracey Posts: 7,395
    edited 2014-11-03 17:08
    Hey Michel!

    Happy to see you back in the mix and with enthusiastic supporters like ValeT who are interested in where this is headed.

    Parallax would like to provide more support for your efforts and move Blockly towards an officially-supported, distributed effort.

    I am sending you an e-mail now to cover this in more detail.

    Sincerely,

    Ken Gracey

    P.S. I put a new BlocklyProp image on your first post.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-11-03 19:00
    Ken Gracey wrote: »
    Hey Michel!

    Happy to see you back in the mix and with enthusiastic supporters like ValeT who are interested in where this is headed.

    Parallax would like to provide more support for your efforts and move Blockly towards an officially-supported, distributed effort.

    I am sending you an e-mail now to cover this in more detail.

    Sincerely,

    Ken Gracey

    P.S. I put a new BlocklyProp image on your first post.
    Blockly looks quite cool. Any chance Parallax would consider using it with an appropriate set of blocks as the graphical programming interface to the S2?
  • Ken GraceyKen Gracey Posts: 7,395
    edited 2014-11-03 19:10
    David Betz wrote: »
    Blockly looks quite cool. Any chance Parallax would consider using it with an appropriate set of blocks as the graphical programming interface to the S2?

    Yes, absolutely. I just can't quite envision how it would look and feel yet, but it's certainly an interest. - Ken
  • Michel LMichel L Posts: 141
    edited 2014-11-04 03:42
    Ken Gracey wrote: »
    Yes, absolutely. I just can't quite envision how it would look and feel yet, but it's certainly an interest. - Ken

    My plans for the S2 programming interface was a smaller screen for the blocks, but having a virtualized S2 next to it where you can simulate the behavior.
    To make it easier to start, I planned to create a whole new set of blocks, specific for the S2. Possibly having similar functionality in the normal version for those that want to hack their S2 and use more then the onboard sensors and motors.

    Michel
  • ValeTValeT Posts: 308
    edited 2014-11-04 04:58
    Ken Gracey wrote: »
    Hey Michel!

    Happy to see you back in the mix and with enthusiastic supporters like ValeT who are interested in where this is headed.

    Parallax would like to provide more support for your efforts and move Blockly towards an officially-supported, distributed effort.

    I am sending you an e-mail now to cover this in more detail.

    Sincerely,

    Ken Gracey

    P.S. I put a new BlocklyProp image on your first post.

    Hi Mr. Gracey,

    Does that mean that other supporters like me will be, for lack of a better term, "kicked off the project"?
  • ValeTValeT Posts: 308
    edited 2014-11-04 05:00
    Michael L,

    Probably a simple question, but I can't seem to figure it out :)

    How do I see the output coming from the ActivityBoard after I load a program onto it? Whenever I click Serial Terminal button, nothing happens. Is this due to bad coding on my part? Or am I missing something simple?
  • Michel LMichel L Posts: 141
    edited 2014-11-04 05:37
    ValeT wrote: »
    Michael L,

    Probably a simple question, but I can't seem to figure it out :)

    How do I see the output coming from the ActivityBoard after I load a program onto it? Whenever I click Serial Terminal button, nothing happens. Is this due to bad coding on my part? Or am I missing something simple?

    Just to be sure: Are you working with the java server or the python client? I haven't used the Java way to connect to the propeller in a long time. I'll need to investigate that this evening.

    Michel
  • ValeTValeT Posts: 308
    edited 2014-11-04 05:46
    Michel L wrote: »
    Just to be sure: Are you working with the java server or the python client? I haven't used the Java way to connect to the propeller in a long time. I'll need to investigate that this evening.

    Michel

    I think I am using the Java client. When I am running Blockly to test, I am running the main class through NetBeans.

    How do I test using the Python client?
  • Michel LMichel L Posts: 141
    edited 2014-11-04 06:18
    ValeT wrote: »
    I think I am using the Java client. When I am running Blockly to test, I am running the main class through NetBeans.

    How do I test using the Python client?

    You'll have to build the application using maven. I don't know if the offline demo version supports the python client. The one I'm sure about (and is hosted at http://blocklyprop.creatingfuture.eu) is the community version. But that one needs to be hosted using php and requires a mysql database.

    One more thing for the technical wiki :p
Sign In or Register to comment.