Shop OBEX P1 Docs P2 Docs Learn Events
Example Project - LCD, DS1302, 16 Key Encoder - Difficulty Level - Approx. 6 — Parallax Forums

Example Project - LCD, DS1302, 16 Key Encoder - Difficulty Level - Approx. 6

idbruceidbruce Posts: 6,197
edited 2011-01-13 15:03 in Propeller 1
lllllllllllllllllllllll

Comments

  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-13 09:16
    Idbruce, very interesting project! Is this open source? You may wish to attach the MIT open source licensing to the code.
  • MagIO2MagIO2 Posts: 2,243
    edited 2011-01-13 10:53
    Hi Bruce,

    what's the range of the difficulty level and which value would be difficult and which would be easy?

    Ehm ... you should have some lessons in data-structures and procedural programming. Besides cleaner code this would also save you a lot of HUB-RAM. Let's see what we can do for you in this thread ;o)

    Lesson one:
    Functions and loops are your friend!
    In the beginning of your code you do the same thing several times.
    1. Clear the screen
    2. Print two lines of text
    3. Wait for 3 sec.
    4. goto 1
    This pretty much looks like a function and a loop could be helpful here. Parameter of the function would be the address of the strings to write. For that you have to move the strings into a dat-section and loop through the strings.
    stringptr := @mystrings          ' where mystrings is the label for the dat section that contains all strings in a row
    repeat 5
      printMessage( stringptr, stringptr+=strsize(stringptr) )
      stringptr+=strsize(stringptr)  
    

    printMessage would then clear the screen, output string 1 in line 1 and string 2 in line 2 and wait for 3 sec.

    This would be a special-case improvement. If you want printMessage to be general-purpose you'd for example only print one string but add the screen-position and call it twice and do the wait in the loop. Both would result in a smaller RAM usage - try it.

    More to come .... ;o)
  • idbruceidbruce Posts: 6,197
    edited 2011-01-13 11:03
    MagIO2

    Are you out to prove that you are a better "SPIN" programmer than me? I am just offering an example for beginners to programming and the Propeller, although you may offer valid suggestions, I feel insulted. Thats okay, if I am so inept, I will remove the post.

    Bruce
  • MagIO2MagIO2 Posts: 2,243
    edited 2011-01-13 11:25
    No reason to feel insulted! That was not my intention. And no ... I'm not out to prove something. I was just offering some lessons on how to improve what you did. A lot of beginners will do their first steps in the same way and improving the code you wrote will also help them.

    As I am not a native english speaker and most times try to write useful posts - for example containing functioning code snippets and hopefully containing as little errors as possible - it often takes 10 minutes or even much more to write a post. If you think I waste my time by answering to this thread, please let me know. I have other good ideas and can spend my time with these instead.
    I feel insulted!
  • idbruceidbruce Posts: 6,197
    edited 2011-01-13 11:29
    Hello Everyone

    Supposedly every attachment that I ever made to Parallax has now been deleted.

    Bruce
  • MagIO2MagIO2 Posts: 2,243
    edited 2011-01-13 11:57
    I suppose you, Bruce, will no longer follow this thread, so maybe someone else can jump in and tell me what I did wrong here.
  • idbruceidbruce Posts: 6,197
    edited 2011-01-13 11:58
    MagIO2

    Please refer to the top post.

    Bruce
  • idbruceidbruce Posts: 6,197
    edited 2011-01-13 12:03
    MagIO2
    Ehm ... you should have some lessons in data-structures and procedural programming. Besides cleaner code this would also save you a lot of HUB-RAM. Let's see what we can do for you in this thread ;o)

    If that is not a very serious insult, I do not know what is.

    You should have some lessons in proper etiquette.

    Bruce
  • MagIO2MagIO2 Posts: 2,243
    edited 2011-01-13 12:26
    The problem with language is that sometimes people communicating with each other have a different understanding/feeling when reading/writing the same sentence. Also sometimes the problem of missunderstanding only arises because of the moods reader and writer are in at the time they read/write. And the language barrier does not make thing easier.

    What I learned in this forum is that nobody wants to insult or humiliate somebody else here. There are forums out there that are much worse in this matter.
  • HughHugh Posts: 362
    edited 2011-01-13 12:57
    idbruce wrote: »
    MagIO2



    If that is not a very serious insult, I do not know what is.

    You should have some lessons in proper etiquette.

    Bruce
    That is not a very serious insult. I wouldn't consider it as the merest hint of an insult having crossed the mind of the author. As a language, German has some fairly rigid formal grammatical structures and MagIO2 has ported them across to his English, as he acknowledges in his other post. The "Ehm.." and ";o)" allude to informality.

    Alas, IMHO, your responses and your impetuous deletion of all your attachments have made yourself look rather immature and a bit of a chump, old bean...

    Hopefully this thread will be locked soon. Crikey. Talk about perpetuating national sterrotypes Bruce. :innocent:
  • idbruceidbruce Posts: 6,197
    edited 2011-01-13 13:02
    Hugh

    I have been programming over 10 years. I can program fairly well in the following languages:
    • C++
    • HTML
    • Perl
    • And now I am learning Spin
    For MagIO2 to post in my thread that:
    Ehm ... you should have some lessons in data-structures and procedural programming.

    Believe me that is an insult.

    Bruce
  • idbruceidbruce Posts: 6,197
    edited 2011-01-13 13:08
    And LOL

    You want data structures, try a few C++ data structures.
  • MagIO2MagIO2 Posts: 2,243
    edited 2011-01-13 13:37
    @Hugh:
    Thank you for your opinion. I really considered that I did something wrong!
    And yes, Bruce does not cool down and maybe it's better to lock this thread.

    @Bruce:
    You can have data structures in any programming language. You seem to mix up data structures with data types.

    I've been programming for 30 years and I'm still open for learning from other coders. But I also like to share knowledge, experience and ideas. That's why I'm here. Your code example made me feel that I should share some of this here.

    Just for completeness, here is my list:
    BASIC
    Assembler of 6502, I486, 8052, PIC, AVR, R8, Propeller
    Pascal
    C
    C++
    Perl
    PHP
    HTML
    XSLT
    Java
    JavaScript
    DCL
    SQL
    PL/SQL
    Forth
    Lisp
    SPIN
  • idbruceidbruce Posts: 6,197
    edited 2011-01-13 13:40
    MagIO2
    You can have data structures in any programming language. You seem to mix up data structures with data types.

    C++?

    Give me the data structure for an icon
  • TCTC Posts: 1,019
    edited 2011-01-13 14:04
    OK, can I say something from an outsider and a beginner (all over again). First off I would like to apologize to anyone that could be offended by what I say in this post.

    When I first seen the subject line about 2 hours ago, I thought “Cool more ideas and maybe a better understanding of SPIN” (having the hardest time). But to my dismay everything was removed. Why? Because someone thought they were being insulted? COME ON NOW! If I had a penny every time that happened to me I would be the richest man on the earth.

    Now this listing has turned from giving others ideas or another way of looking at things into a peeing contest. Please let’s start over, repost the information and see what happens.
  • idbruceidbruce Posts: 6,197
    edited 2011-01-13 14:08
    TC

    I will be more than happy to email you the files.

    Bruce
  • TCTC Posts: 1,019
    edited 2011-01-13 14:15
    If they are emailed to me then I have only one idea on how it works. I am not saying “this person’s idea is better than that person”. I am saying we should have other ideas from different sources.
  • idbruceidbruce Posts: 6,197
    edited 2011-01-13 14:28
    TC

    I could not agree more. It was not so much what he said, but how he said it. It could have been very constructive, if he had simply said "Bruce here are a few recommendations to reduce loop count and the HUB-RAM required". It could have then turned into a better example then the one I provided. You and I could have both learned from it.

    However, I will not continue to provide source code if I feel that people with more "SPIN" programming experience than me are insulting me.

    Bruce
  • TCTC Posts: 1,019
    edited 2011-01-13 14:55
    This is a family based forum; no one here is trying to insult you. And I am sorry you feel that way. And because you feel you were insulted you are punishing other people by not having your ideas on here so others can admire it.

    You want to talk about insulting?

    About 2 years ago I was in a horrific motorcycle accident. Going 65MPH on the freeway, car changes lanes clips my back tire. I go over the handle bars and hit the ground with my face (leaving out gory details). After 6 months in a coma, I wake up to find out I no longer look like I used to and I am missing some facial features. (Again leaving out gory details). I can’t walk in the mall or anywhere else without some teenage kid pointing and laughing. THAT is insulting! Because now not just the kid is staring, but so is everyone else. But you know what "I don't care"!
  • idbruceidbruce Posts: 6,197
    edited 2011-01-13 15:03
    TC

    Yes, I can imagine that being insulting, but that does not change the fact that I take pride in my work and my programming.

    Bruce
Sign In or Register to comment.