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

Open Propeller Project #5: BlocklyProp

1234579

Comments

  • ValeTValeT Posts: 308
    edited 2014-11-04 06:29
    So to test it successfully I need to download, compile, and run BocklyPropCient, then go to http://blocklyprop.creatingfuture.eu?

    I'm sorry I am so confused.
  • Michel LMichel L Posts: 141
    edited 2014-11-04 07:14
    ValeT wrote: »
    So to test it successfully I need to download, compile, and run BocklyPropCient, then go to http://blocklyprop.creatingfuture.eu?

    I'm sorry I am so confused.

    Yes, indeed. Of course, until I put a build online including your changes, your blocks won't be available.
    If you are running Windows you can also just download an executable from http://owncloud.creatingfuture.eu/public.php?service=files&t=0eae565db031cd3ca3f1163de91c5984
    Although, these could be a bit out of date.

    When I'm home, I'll have a look at the java version. Then you can test your own blocks that way. Without needing python, php and mysql.

    Michel
  • ValeTValeT Posts: 308
    edited 2014-11-04 08:04
    Michel L wrote: »
    Yes, indeed. Of course, until I put a build online including your changes, your blocks won't be available.
    If you are running Windows you can also just download an executable from http://owncloud.creatingfuture.eu/public.php?service=files&t=0eae565db031cd3ca3f1163de91c5984
    Although, these could be a bit out of date.

    When I'm home, I'll have a look at the java version. Then you can test your own blocks that way. Without needing python, php and mysql.

    Michel

    Thank you. I have already downloaded that on my main machine, but since I didn't realize it was used in that way, I haven't tried to run it.

    Thank you as well for taking a look at the Java version.

    As a side question, what is the "\\r" text/code used for in the print block code? I am writing my own block for the console category, and do not know whether I need to add this to my block.
  • Michel LMichel L Posts: 141
    edited 2014-11-04 11:05
    ValeT wrote: »
    Thank you. I have already downloaded that on my main machine, but since I didn't realize it was used in that way, I haven't tried to run it.

    Thank you as well for taking a look at the Java version.

    As a side question, what is the "\\r" text/code used for in the print block code? I am writing my own block for the console category, and do not know whether I need to add this to my block.

    So far, I didn't find a problem with the serial in the Java version. When I open the console I immediately get a message that it connected on the given COM port. I'll now install the prop-gcc toolchain to be able to use the C version again.

    the "\\r" adds a newline (actually: return) to the given text. So it prints each statement on a separate line.

    Michel
  • ValeTValeT Posts: 308
    edited 2014-11-04 11:41
    Michel L wrote: »
    So far, I didn't find a problem with the serial in the Java version. When I open the console I immediately get a message that it connected on the given COM port. I'll now install the prop-gcc toolchain to be able to use the C version again.

    the "\\r" adds a newline (actually: return) to the given text. So it prints each statement on a separate line.

    Michel

    Ok thank you. That makes more sense.

    Really? To open the serial console, I just click the Serial Terminal button right?
  • Michel LMichel L Posts: 141
    edited 2014-11-04 12:13
    ValeT wrote: »
    Ok thank you. That makes more sense.

    Really? To open the serial console, I just click the Serial Terminal button right?

    Yes, just first select the correct COM port (Are you using Windows?) And then clicking Serial Console.
  • ValeTValeT Posts: 308
    edited 2014-11-04 12:34
    Michel L wrote: »
    Yes, just first select the correct COM port (Are you using Windows?) And then clicking Serial Console.

    Yes, I am using Windows 8. I will try that when I get home tonight.

    Thanks for all the help.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-11-04 17:39
    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
    I skimmed this thread from the start and it seems like quite a lot of the work is already done. Is there room for additional contributors? Would it be helpful to start looking at the current S2 IDE to get ideas about how to map it onto Blockly blocks or has that already been done?
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-11-04 21:02
    David Betz wrote: »
    I skimmed this thread from the start and it seems like quite a lot of the work is already done. Is there room for additional contributors? Would it be helpful to start looking at the current S2 IDE to get ideas about how to map it onto Blockly blocks or has that already been done?

    I think so. Today I started to skim the threads but I got distracted by people hanging around my desk, so I decided I'll give this a close look on Thursday.

    I'm not clear on how the download process works. And, I can assure you that if this could be made to work with Chromebooks we will happily supplement the effort financially.

    Michel wrote me a message yesterday and I won't get to read it in detail until Thursday morning due to guest commitments, but this is something I want to determine. If you can be patient and let me get caught up to the point that I can understand what we need to do to encourage progression of Blockly we certainly shall. Give me a day or two.

    Ken Gracey
  • ValeTValeT Posts: 308
    edited 2014-11-05 13:43
    Most recently, I have been working on adding multicore capabilities for propc.

    I have encountered just a small little issue though :). When I try to download the code onto the propeller ActivityBoard, it gives me an error saying that the function cog_run is undefined. Below is the code that I am using to start the new cog.
    'use strict';
    
    
    if ( !Blockly.Language )
      Blockly.Language = {};
      
      
    Blockly.Language.cog_new = {
      category: 'Control',
      helpUrl: '',
      init: function() {
        this.setColour( 120 );
        this.appendDummyInput()
          .appendTitle( "cognew" );
        this.appendValueInput( "STACK_SIZE", Number )
          .appendTitle( "Stacksize" )
          .setCheck( Number );
        this.appendStatementInput( "METHOD" )
          .appendTitle( "Method" );
        this.setInputsInline( true );
        this.setPreviousStatement( true, null );
        this.setNextStatement( true, null );
      }
    };
    
    
    //get generators
    Blockly.propc = Blockly.Generator.get( 'propc' );
    
    
    Blockly.propc.cog_new = function() {
      var method = Blockly.propc.statementToCode( this, 'METHOD' );
      method = method.replace( "  ", "" ).replace( "\n", "" ).replace( "()", "" ).replace( ";", "" );
      var stackSize = Blockly.propc.valueToCode( this, 'STACK_SIZE', Blockly.propc.ORDER_ATOMIC ) || '10';
      
      var stackName = 'Stack' + Blockly.propc.stacks_.length;
      Blockly.propc.stacks_.push('long ' + stackName + '[' + stackSize + '];');
      
      var code = 'cog_run( &' + method + ', ' + stackName + ' );';
      return code;
    };
    
  • David BetzDavid Betz Posts: 14,516
    edited 2014-11-05 13:50
    I'm afraid I didn't read this thread closely enough to know how propgcc was integrated. Is it using the Simple Libraries that come with SimpleIDE or just the libraries that come with propgcc itself? I ask because I believe cog_run is in the Simple Libraries. Maybe it would be best to stick with using standard propgcc functions in Blockly since the Simple Libraries are currently evolving and are only available with SimpleIDE?
  • ValeTValeT Posts: 308
    edited 2014-11-05 14:24
    Is there a way to start a new cog using PropGCC libraries? I am not familiar with PropGCC and do not know what functions are available.

    I am not sure if it has SimpleIDE libraries but in my code I am including simpletools.h. Shouldn't that have the cog_run function in it?
  • David BetzDavid Betz Posts: 14,516
    edited 2014-11-05 15:00
    ValeT wrote: »
    Is there a way to start a new cog using PropGCC libraries? I am not familiar with PropGCC and do not know what functions are available.

    I am not sure if it has SimpleIDE libraries but in my code I am including simpletools.h. Shouldn't that have the cog_run function in it?
    Yes, simpletools.h is the correct header as far as I know. I'm not sure why cog_run is undefined. Maybe you have an old version of simpletools? In any case, the standard propgcc library includes cognew and coginit for starting PASM code and cogstart for starting C code running in another COG. If this project is going to make use of simpletools, maybe it might make sense to ask Parallax to put the library in a github repository or on Google Code and provide tags for each release so we can track the version used by this project better.

    Here is where you can find information about the standard functions that come with propgcc:

    https://sites.google.com/site/propellergcc/documentation/libraries/propeller-h-library
  • Michel LMichel L Posts: 141
    edited 2014-11-05 15:03
    The only required import is simpletools but the generated code should contain that import by default:
    #include "simpletools.h"

    I'm not sure anymore how I implemented the compiling using java. As I previously stated the currently supported version uses the python client to compile and load.
    As abdrive and abvolts do work, I would expect that cog_run also works.
  • Michel LMichel L Posts: 141
    edited 2014-11-05 15:10
    I just checked, the simple libs (in the java version) do not include cog_run

    You can find them in https://github.com/michel-cf/BlocklyProp/tree/master/propeller-c-lib
  • ValeTValeT Posts: 308
    edited 2014-11-05 15:31
    Michel L wrote: »
    I just checked, the simple libs (in the java version) do not include cog_run

    You can find them in https://github.com/michel-cf/BlocklyProp/tree/master/propeller-c-lib

    How do I go about "installing" the cog_run library? Or even a better solution, how do I test my blocks without using the Java version?
  • ValeTValeT Posts: 308
    edited 2014-11-05 15:36
    Since the Java version does not have the cog_run capability, and I have checked my code and am pretty sure that it works, I have created a pull request for creating/starting a cog in propc.

    That would be a smart idea. It would be great if Parallax would be able to upload all of their libraries to Github, allowing everyone easy access to the source code. Parallax shouldn't even have to do it. Anyone should be able to work on that. All they would need is about three or four hours of free time to copy and paste, copy and paste :)
  • David BetzDavid Betz Posts: 14,516
    edited 2014-11-05 16:21
    ValeT wrote: »
    Since the Java version does not have the cog_run capability, and I have checked my code and am pretty sure that it works, I have created a pull request for creating/starting a cog in propc.

    That would be a smart idea. It would be great if Parallax would be able to upload all of their libraries to Github, allowing everyone easy access to the source code. Parallax shouldn't even have to do it. Anyone should be able to work on that. All they would need is about three or four hours of free time to copy and paste, copy and paste :)
    It is very possible that the libraries are already on github. It should be Parallax that hosts them because then there is only one official source and there is less likely to be fragmentation and multiple incompatible versions.
  • ValeTValeT Posts: 308
    edited 2014-11-06 10:07
    David Betz wrote: »
    It is very possible that the libraries are already on github. It should be Parallax that hosts them because then there is only one official source and there is less likely to be fragmentation and multiple incompatible versions.

    Yeah, that's true. Just makes more work for Parallax though.
  • Heater.Heater. Posts: 21,230
    edited 2014-11-06 10:27
    ValeT,
    Yeah, that's true. Just makes more work for Parallax though.
    Interesting. Either Parallax "owns" the project, maintains it and keeps it up to date etc. Or they don't, in which case someone else may step up up to the plate. fork the thing, and continue development. Or no body is bothered and it all languishes.
  • msrobotsmsrobots Posts: 3,709
    edited 2014-11-06 12:23
    @Michel L.

    Good to read you are back again. I still have no PropTime. All projects on ice. I really like the community idea of BlockyProp. You are doing a great job with all of this. Thank you.

    @ValeT,

    love your username.

    I also like your enthusiasm. You are learning a lot of stuff pretty fast as far as I follow your posts. Thank you too.

    @ALL

    It seems more and more that @Heater. needs to work for Parallax. Organizing the Open Source, GIT and Multiplatform efforts. If H1 Visa are to complicated - just adopt him?

    Get that guy out of the freezing northern parts of Europe into the sunny northern part of California! Free @Heater!

    Enjoy!

    Mike
  • Heater.Heater. Posts: 21,230
    edited 2014-11-06 13:39
    msrobots,
    Free @Heater!
    Oh what!

    What an excellent idea!

    I'm a little bit too old to be adopted though.
  • Michel LMichel L Posts: 141
    edited 2014-11-06 14:30
    BlocklyProp and BlocklyPropClient have now moved to the official Parallax GitHub.

    Forking and pull requests are of course still welcome, just change the remote url to https://github.com/parallaxinc/BlocklyProp.git
  • ValeTValeT Posts: 308
    edited 2014-11-06 14:51
    msrobots wrote: »
    @Michel L.

    Good to read you are back again. I still have no PropTime. All projects on ice. I really like the community idea of BlockyProp. You are doing a great job with all of this. Thank you.

    @ValeT,

    love your username.

    I also like your enthusiasm. You are learning a lot of stuff pretty fast as far as I follow your posts. Thank you too.

    @ALL

    It seems more and more that @Heater. needs to work for Parallax. Organizing the Open Source, GIT and Multiplatform efforts. If H1 Visa are to complicated - just adopt him?

    Get that guy out of the freezing northern parts of Europe into the sunny northern part of California! Free @Heater!

    Enjoy!

    Mike

    Thanks msrobots!

    Also, Michael L, does this affect contributors at all?
  • msrobotsmsrobots Posts: 3,709
    edited 2014-11-06 15:18
    Heater. wrote: »
    msrobots,

    Oh what!

    What an excellent idea!

    I'm a little bit too old to be adopted though.

    Hmm. The Father of them G. Brothers is for sure older... don't go that marriage way ... H1 may be easier then...Not sure about that, but can someone immigrate into the US of A as new citizen of a Indian tribe?

    Teleworking/Contracting would mess up the whole concept of freeing @Heater.

    @Michel L.

    wow - Parallax at GIT-Hub. Wonderful.

    Enjoy!

    Mike
  • Michel LMichel L Posts: 141
    edited 2014-11-07 02:11
    ValeT wrote: »
    Thanks msrobots!

    Also, Michael L, does this affect contributors at all?

    ValeT, you can contribute just like before. If you have something done you can still create a pull request and I will merge it.

    The only thing you have to change is the remote url. https://github.com/parallaxinc/BlocklyProp.git
  • ValeTValeT Posts: 308
    edited 2014-11-07 03:17
    Michel L wrote: »
    ValeT, you can contribute just like before. If you have something done you can still create a pull request and I will merge it.

    The only thing you have to change is the remote url. https://github.com/parallaxinc/BlocklyProp.git

    Ok. Thanks for clearing that up for me.

    I got 3 new blocks that I am about to add...just got to troubleshoot one of them :)
  • ValeTValeT Posts: 308
    edited 2014-11-07 09:47
    Michael L,

    Quick question. What is the difference between definitions and setups in the propc code? I an unsure which one to use where.

    Thanks,
    ValeT
  • Michel LMichel L Posts: 141
    edited 2014-11-07 14:05
    ValeT wrote: »
    Michael L,

    Quick question. What is the difference between definitions and setups in the propc code? I an unsure which one to use where.

    Thanks,
    ValeT

    ValeT,

    good question, I had to look it up in the code.

    Definitions are used for includes, while setups are pieces of code that are executed first in the main function.
    #include "simpletools.h"
    #include "abvolts.h"
    
    int analog;
    
    
    int main() {
      ad_init(21, 20, 19, 18);
      high(3);
      analog = ad_in(0);
    
    }
    

    In this example I used the analog digital converter code for the ActivityBoard. I included the line: "high(3)" to keep the ad_init and ad_in line seperate.

    #include "abvolts.h" -> definitions
    ad_init(21, 20, 19, 18); -> setups
    ad_in(0) -> code of the block itself

    So, even though the AD block was not the first in the program, the ad_init was still added at the start.

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

    good question, I had to look it up in the code.

    Definitions are used for includes, while setups are pieces of code that are executed first in the main function.
    #include "simpletools.h"
    #include "abvolts.h"
    
    int analog;
    
    
    int main() {
      ad_init(21, 20, 19, 18);
      high(3);
      analog = ad_in(0);
    
    }
    

    In this example I used the analog digital converter code for the ActivityBoard. I included the line: "high(3)" to keep the ad_init and ad_in line seperate.

    #include "abvolts.h" -> definitions
    ad_init(21, 20, 19, 18); -> setups
    ad_in(0) -> code of the block itself

    So, even though the AD block was not the first in the program, the ad_init was still added at the start.

    Michel

    Thanks for the clarification! This helped me avoid horrible mistakes when making the debug_lcd blocks :)
Sign In or Register to comment.