Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Learn Start Simple Tutorial - Page 2 — Parallax Forums

Propeller Learn Start Simple Tutorial

2»

Comments


  • Finished lesson 3 last night.

    This lesson is Variable Arrays.

    Anybody using Gear Propellor Debugger Emulator?
  • If you plug in "Gear Propellor Debugger" in the search window in the upper right, you will find many threads on the subject.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-10-18 21:06

    Publison

    It does not like it is being developed really.

    Looks like Viewport is the way to go.

    Anybody have a good email for Viewport?

    Link on site isn't working.
  • Veiwport is available at:

    http://onerobot.org/

    It is very powerful, but it has not been updated in at least 6 years.

    Hanno, the author also did 12Blocks on his site, and the software for the Parallax Scope:

    https://www.parallax.com/product/32220

    It's a great price at $99. I paid $249.00 when it first came out.

  • Here's the lesson on Array Variables
    /* 
      Array Variables.c  
       
      Declare and initialize an array and display a couple of its elements.
      
      http://learn.parallax.com/propeller-c-start-simple/array-variables
    */
    
    #include "simpletools.h"                      // Include simpletools
    
    int main()                                    // main function
    {
      int p[] = {1, 2, 3, 5, 7, 11};              // Initialize the array
      print("p[0] = %d\n", p[0]);                 // Display what p[0] stores
      print("p[3] = %d\n", p[3]);                 // display what p[3] stores
    }
    

    Will run it and read explanation.

  • Finished up Array Variables

    Here's code for Make a Decision.
    /*
      Make a Decision.c
      
      If a condition is true, display a second message.
      
      http://learn.parallax.com/propeller-c-start-simple/make-decision
    */
    
    #include "simpletools.h"                      // Include simpletools
    
    int main()                                    // main function
    {
      int a = 25;                                 // Initialize a variable to 25
      int b = 17;                                 // Initialize b variable to 17
      print("a = %d, b = %d\n", a, b);            // Print all
      if(a > b)                                   // If a > b condition is true
      {
        print("a is larger \n");                  // ...then print this message
      }
    }
    
  • yetiyeti Posts: 818
    edited 2017-10-20 12:42
    Anybody using Gear Propellor Debugger Emulator?
    I played a bit with GEAR-V14.07.03 but it sometimes crashes (at least on Debian).

    For stuff that needs not more periphery than a serial and EEPROM I prefer SpinSim. But that's not perfect too: Try PropForth or some other really complex stuff in it... :-(

    (The attached picture is not from a crash of GEAR. It shows a Mandelbrot image being calculated and shown on a VGA screen simulated by GEAR.)
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-10-20 14:42
    Yeti

    We will just use Propeller 'as is'.

    If in almost 20 years Parallax has not seen fit to add a simulator or a hardware debugger then 'Oh well'.

    It is a teaching system and hobbyist platform like Picaxe.

    So we will be learning and hobbying!

    I think it's fine the way it is.

    In this first tutorial they keep hitting you over the head with PRINT statement.

    They're saying 'Debug with PRINT'.

    :smile: :
  • Listen to Jon he certainly knows what he's talking about. I spent a bunch of time, reading about, talking about, and thinking about writing code and the only thing I wasn't doing was actually writing code.
    Funny thing is I started a project which I have not completed to try to teach myself to code and ended up writing code and was having so much fun learning that I completely forgot about my original project. I have been trying every command just to see what happens, the worse thing that can happen is I damage a board or two but in the big scheme of things who cares as long as I'm learning something, right?

  • Thanks!

    Okay.Will do!

  • In this 'Make a Decision' lesson.

    It covers 'Relational Operators'.

    What is this first character.

    != Not equal to

    Is that an exclamation mark or a bar?
  • Cluso99Cluso99 Posts: 18,069
    Exclamation ! Means not.

  • Cluso

    Thx!

    Hard to make out what it is for some reason.
  • Cluso99Cluso99 Posts: 18,069
    The vertical bar | is used for "OR"

  • Cluso

    Thanks again!

    Will finish this lesson tonight.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-10-21 06:12
    Ran the Example source code.

    I like the little 'Build Status' output window down the bottom.

    I'm surprised this statement picked up the 'a' variable value the way it's written.
    {
        print("a is larger \n");                  // ...then print this message
      }
    }
    

    EDIT

    How do you turn on highlighting in this editor?

    I like the templates in the My Projects directory.

    What is Simple program and C++ program mean?

  • Found a bug.

    I swapped values for a and b.

    To get it to fail test and never execute block of code.

    'Close All'. It did not ask 'Do you want to save?'. It just saved it.

    That's not very good. You can screw up your sample programs.
  • Heater.Heater. Posts: 21,230
    Is that a bug or just the way things work?

    My favorite editor today is Microsoft's Visual Studio Code: https://code.visualstudio.com/

    Sure enough, open up VS code. Type something. Then close it. It saves everything without asking. When you open it up again everything is there, just the way you left it.

    Can I screw up my programs this way?

    Perhaps. That almost never happens. And if it does there is no harm done. All my projects live it git repositories so I can use git to get back to the last working version any time. I find git amazingly helpful that way, even for the smallest projects.




  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-10-21 17:11
    Heater

    You are right. It is a good feature when your coding along.

    Right now though I would prefer the examples had the 'Do you want to save?'.

    Starting next lesson. Make Several Decisions.

    I like these tutorials!

  • Okay. We're up to 'Make Several Decision's '.

    Yes I do like these tutorials.

    IF...ELSE...ELSE is fun.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-10-25 05:05

    Running the code will be delayed.

    Due to real world tasks.

    Target time window is tomorrow. Probably PM.
Sign In or Register to comment.