Shop OBEX P1 Docs P2 Docs Learn Events
Thinking out loud...what is wrong with this world? - Page 2 — Parallax Forums

Thinking out loud...what is wrong with this world?

2»

Comments

  • JonnyMacJonnyMac Posts: 9,102
    edited 2021-11-28 16:12

    Libraries are evil
    All of this needed no libraries.

    Libraries promote the effective/consistent reuse of vetted code.

  • @pik33 said:
    We need only a set of functional code snippets to do all these things we need.

    :+1::+1:

    Precisely :smile:

  • As long as those snippets come with vetting, comments, do basic parameter checking, and handle errors in a planned manner, I totally agree. (Sorta like… umm… libraries, actually!)

  • MicksterMickster Posts: 2,693
    edited 2021-11-28 18:23

    Like the two examples that were provided by @Ariba for configuring PWM and quadrature counting....and this relative-know-nothing (heck I used a word that I thought meant idiot but I checked and it means something completely different :o ) is off to the races :lol:

    Only thing I need to figure-out now is serial comms which don't worry me at all :+1:

  • Fully agree on the points in the initial post. BASIC is a fine language, just suffers from a bad name. Everything is perfectly readable and maintaining old code is so easy. In fact, I boldly claim that BASIC is a much better language than Python (which is S**t in my own view), but... marketing runs the game.
    If there was a "new" language 1:1 copy of BASIC, but with some new and fancy name, with enough noise it may well take over.
    Pascal is equally nice, and just like BASIC suffers from artificially made bad reputation. Should be much more promoted as a viable choice.

  • @knivd said:
    Fully agree on the points in the initial post. BASIC is a fine language, just suffers from a bad name. Everything is perfectly readable and maintaining old code is so easy. In fact, I boldly claim that BASIC is a much better language than Python (which is S**t in my own view), but... marketing runs the game.
    If there was a "new" language 1:1 copy of BASIC, but with some new and fancy name, with enough noise it may well take over.
    Pascal is equally nice, and just like BASIC suffers from artificially made bad reputation. Should be much more promoted as a viable choice.

    Well, everything that I do is paid-for and therefore, needs to be done in the shortest possible time. I need the Prop for 12-axis, closed loop motion control....absolute breeze with FlexBasic...all running beautifully.
    I want an interpreter on the front-end and so I use the Picomite (Micromite Basic interpreter)
    My HMI is an Android device because I don't believe in proprietary data-input/output devices in this day and age. Here I use RFO Basic (interpreter) + Mougino's add-on libraries.

    All of this Basic stuff adds-up to a product that has no equal and I will accept any challenges :smile:

  • Hi Mickster!

    Would you be able to demo your system on P2 Live Forum ?

    What you have created sounds awesome, and I reckon a lot of people would be interested.

  • @VonSzarvas said:
    Hi Mickster!

    Would you be able to demo your system on P2 Live Forum ?

    What you have created sounds awesome, and I reckon a lot of people would be interested.

    Sure, although for most of this community, what I'm doing with the P2 is a bit of a ho-hum. PIDs and trajectory generators are not exactly a challenge for this device :D

  • VonSzarvasVonSzarvas Posts: 3,450
    edited 2021-11-29 09:53

    Yeah, your right. But I still think the finished concept would be interesting (and inspiring), to see how P2 is actually working in commercial products.

    I'll drop a note to Ken with the details so he can reach out to you next time he's planning P2LF schedules.

    In the meantime.... Thanks for thinking about doing this!

  • ColeyColey Posts: 1,110

    @Mickster said:

    @VonSzarvas said:
    Hi Mickster!

    Would you be able to demo your system on P2 Live Forum ?

    What you have created sounds awesome, and I reckon a lot of people would be interested.

    Sure, although for most of this community, what I'm doing with the P2 is a bit of a ho-hum. PIDs and trajectory generators are not exactly a challenge for this device :D

    Although I've seen some of your work first hand I'd be interested in seeing more.

    It always nice to see another Brit from the North West of England flying the P2 flag ;)

  • @Mickster said:
    I want an interpreter on the front-end and so I use the Picomite (Micromite Basic interpreter)

    I just stared testing the Picomite, just out of curiosity do you have a sense of how fast MMBasic is when compared to flexbasic on a p2?

  • @Mickster said:

    @VonSzarvas said:
    Hi Mickster!

    Would you be able to demo your system on P2 Live Forum ?

    What you have created sounds awesome, and I reckon a lot of people would be interested.

    Sure, although for most of this community, what I'm doing with the P2 is a bit of a ho-hum. PIDs and trajectory generators are not exactly a challenge for this device :D

    How you work, is where the high value is. I would enjoy and benefit from seeing it personally.

  • @aaaaaaaargh said:

    @Mickster said:
    I want an interpreter on the front-end and so I use the Picomite (Micromite Basic interpreter)

    I just stared testing the Picomite, just out of curiosity do you have a sense of how fast MMBasic is when compared to flexbasic on a p2?

    Nothing more than a simple if a = 3 then a = 5, type of thing. FlexBasic @250MHz was 7.772 million/sec whereas MMBasic was around 100,000/sec :lol:

  • @Mickster said:
    Nothing more than a simple if a = 3 then a = 5, type of thing. FlexBasic @250MHz was 7.772 million/sec whereas MMBasic was around 100,000/sec :lol:

    Very cool, thanks!

  • @Coley said:

    @Mickster said:

    @VonSzarvas said:
    Hi Mickster!

    Would you be able to demo your system on P2 Live Forum ?

    What you have created sounds awesome, and I reckon a lot of people would be interested.

    Sure, although for most of this community, what I'm doing with the P2 is a bit of a ho-hum. PIDs and trajectory generators are not exactly a challenge for this device :D

    Although I've seen some of your work first hand I'd be interested in seeing more.

    It always nice to see another Brit from the North West of England flying the P2 flag ;)

    Hey buddy.....need to catch-up sometime before BoJo pulls another fast one.
    Would you believe that one of the most active members of the MMBasic community is in Leyland? :)

  • ColeyColey Posts: 1,110

    @Mickster said:

    @Coley said:

    @Mickster said:

    @VonSzarvas said:
    Hi Mickster!

    Would you be able to demo your system on P2 Live Forum ?

    What you have created sounds awesome, and I reckon a lot of people would be interested.

    Sure, although for most of this community, what I'm doing with the P2 is a bit of a ho-hum. PIDs and trajectory generators are not exactly a challenge for this device :D

    Although I've seen some of your work first hand I'd be interested in seeing more.

    It always nice to see another Brit from the North West of England flying the P2 flag ;)

    Hey buddy.....need to catch-up sometime before BoJo pulls another fast one.
    Would you believe that one of the most active members of the MMBasic community is in Leyland? :)

    Let's see if we can catch up before Christmas then. I'll PM you.

  • @Mickster said:
    I am typing perfectly legible FlexBasic code and it simply works and is readable...I look at code that is written in other languages and it is just effed-up!!!!

    Why do we do this?

    I became self-employed in 1986, thanks to QuickBasic and have only kicked butt ever since.

    BASIC has interpreters AND compilers... Does any other language?

    Python. Its all a matter of what you want to do, and how fast you need it to run.

  • @mallen said:

    @Mickster said:
    I am typing perfectly legible FlexBasic code and it simply works and is readable...I look at code that is written in other languages and it is just effed-up!!!!

    Why do we do this?

    I became self-employed in 1986, thanks to QuickBasic and have only kicked butt ever since.

    BASIC has interpreters AND compilers... Does any other language?

    Python. Its all a matter of what you want to do, and how fast you need it to run.

    Well, similar to a high-end CNC, there is the real-time system that drives and coordinates the axes and then there's the G-code interpreter that commands the positioning of the axes. In my case, FlexBasic and P2 handle the real-time portion and MMBasic (interpreter) provides the sequence commands that are edited directly on the chip...no need to compile. All that's needed is a VT-100 terminal.

  • CNC is not really a matter of stupid flat-out speed. What is much more important is consistent speed. When something is supposed to be executed in one millisecond, it shall be done in one millisecond. It is completely useless to design a system that does most of those things in a microsecond and for a few of those things takes a minute, even if the total time is less. S.

  • pik33pik33 Posts: 2,366
    edited 2021-12-05 11:44

    Now, FlexBasic can open a file on a SD card and input/output data from it.

    (1) why I got every second empty line and what exactly commas do?

    This code

     mount "/sd", _vfs_open_sdcard()
     open "/sd/testbas.txt" for input as #2
    
    for i=1 to 20
    input #2, n$
    print n$
    next i
    
    

    returns this:

    ( Entering terminal mode.  Press Ctrl-] or Ctrl-Z to exit. )
    6
    
    7
    
    8
    
    9
    
    0
    
    1
    
    kwas
    

    while the test file looks like this:

    6
    7
    8
    9
    0
    1,2,3,4,5
    kwas
    
    

    (2) Is there any way to list the directory or check if file exists?

  • __deets____deets__ Posts: 203
    edited 2021-12-05 13:02

    You are printing a line that contains a newline, and print itself adds a newline.

    I'm not an expert on BASIC, but in the open line you assign the file-descriptor #2 to the opened file. This is an argument for the input statement, as well as the variable in which to read the line into. So the comma is needed to separate these arguments I'd say.

    Oh, I think I now understand your question properly. The output only goes until the first comma. I'm as confused as you are about that.

  • Why do you open the file so often?

  • "input n$" reads a string from the file. The data are separated by commas, so if the input data is 1,2,3 then only the "1" gets put into the read string.

  • pik33pik33 Posts: 2,366
    edited 2021-12-05 17:41

    Now the question is: why it didn't input "2,3,4,5"

    Edit.. and then it input "kwas"

  • Get rid of the for-next and wait for whatever constitutes an EOF, I guess (?)

  • pik33pik33 Posts: 2,366

    @"Christof Eb." said:
    Why do you open the file so often?

    I open the file once, at the start

    @Mickster said:
    Get rid of the for-next and wait for whatever constitutes an EOF, I guess (?)

    How can I wait for something I read from the file?

  • tritoniumtritonium Posts: 543
    edited 2021-12-06 00:16

    Hi

    Normally to input a complete line of text ignoring commas in most 'Basics' the function "line input#" is used.
    Not sure if this is supported in flexbasic

    Dave

  • @pik33 said:

    @"Christof Eb." said:
    Why do you open the file so often?

    I open the file once, at the start

    @Mickster said:
    Get rid of the for-next and wait for whatever constitutes an EOF, I guess (?)

    How can I wait for something I read from the file?

  • Could this topic have a more meaningful title?

  • @TonyB_ said:
    Could this topic have a more meaningful title?

    Starting to look like a youtuber's click-bait, right?

Sign In or Register to comment.