IF..THEN syntax - Page 2


Closed Thread
Page 2 of 2 FirstFirst 12
Results 41 to 53 of 53

Thread: IF..THEN syntax

  1. #41
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    The issue of pirate copies will never go away. In an ideal world there would be no murders, break-ins, car jacking, robberies, hacking or bootlegging etc... but we don't live in an ideal world.

    Someone mentioned cost... I've seen $10 applications pirated and placed up on the net for download, so its not the fact that a genuine copy cost so much. It seems that the low life that pirate these applictions do it just for fun or kudos.

    In the example of reading a book rather than buying it, thats a bad example as you are still causing finacial hardship to both the author, publisher and retailer as its a lost sale. I mean you would hardly go out and buy the book for yourself if you had read your friends copy from cover to cover.

  2. #42
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I agree with most that you say with the exception of the book example.

    If I buy a book (or CD or DVD or whatever), I'll probably read it and like with most people it is then destined to spend the rest of it's life abandoned on the shelf. You can come along and borrow the book, read it and return it to me. I can sell that book or give it away to someone else. But at any instance in time, only ONE COPY exists, but more than one person can enjoy the book, certainly not just the person who originally bought it. After all, all your school textbooks have probably been read many times before you and long after you have finished with them. Libraries would not exist where a single copy can be borrowed for the enjoyment of many. The objection is where someone COPIES the original work without recompensing the author/publisher.

  3. #43
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Another point of view is from me.

    For US$10, I buy a pirate copy of a US$900 software.
    I do the job and earn US$2,500.
    Then I go to the shop and buy the original version at US$900.
    Me = happy, software maker=happy, customer=happy

    This is the way for me to buy the original version.

    Who can call me a pirate software user?


    ----------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  4. #44
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sayzer View Post
    Another point of view is from me.

    For US$10, I buy a pirate copy of a US$900 software.
    I do the job and earn US$2,500.
    Then I go to the shop and buy the original version at US$900.
    Me = happy, software maker=happy, customer=happy

    This is the way for me to buy the original version.

    Who can call me a pirate software user?

    ----------------------
    At the point of doing the actual job you were a pirate user but having bought the software I suppose that legitimises it.

    I have done similar with a disney film. Saw it at the movies, got a downloaded copy for the kids to watch (VCD) and then when the DVD came out I bought it so I dont feel that I have cheated Disney out of anything.

    Having said that, we went to the Cinema a couple of weeks ago to see Night at the Museum. Good family film, current release. Last week I was talking to someone who said they hadnt seen it yet because they lent THEIR DVD to someone THREE WEEKS AGO before it was even on cinema release here.

    I very much doubt that they have any intention of getting a genuine DVD once it is released and that is true of many users of Pirate Software
    Keith

    www.diyha.co.uk
    www.kat5.tv

  5. #45
    Join Date
    Jan 2007
    Posts
    37


    Did you find this post helpful? Yes | No

    Default

    I dont want to upset someone but think about this . Try to imagine word if there was no piracy. First look on internet : where all those web sites what people create ? Where all those drawing ? where flash cartons and games where all DJ ? where...? are we back in 70?

  6. #46
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Melanie,

    Good point with the book anology...

    As a side issue (and now way off topic for this thread) I wonder if having a fully working, but resticted version of PBP would affect the sales of PBP dramatically. Something like Mikrobasic, which offers the chance to write full programs with a limit of 2K compiled HEX. I wonder if it would also reduce the amount of pirated copies that find their way into the home / hobby user..? But then again, I would susspect that some low life would come up with a means of getting past the restriction and removing the limit.... just can't win !

  7. #47
    Join Date
    Oct 2006
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    As a side issue (and now way off topic for this thread)
    Hmmm... I believe that the issue is really way off topc for this thread. I hope someone moderates this. Hehehe.. I kinda get excited everytime I got a notice in my email that someone replied in this thread. I'm always thinking that another golden advice regarding the topic I started would be given. Though I didn't get any related advice, the excitement that I felt when I was thinking of a solicited advice was replaced with the excitement about issues that in one way or another affect our lives as users or producers. I suggest we start another forum topic regarding the issue. More power!

  8. #48
    Join Date
    Oct 2006
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scaenix View Post

    'Read Cds cell #1 on port b line 1
    'Read Cds cell #2 on port b line 7
    v1 var byte 'Variable v1 holds Cds #1 information
    v2 var byte 'Variable v2 holds Cds #2 information
    v3 var byte 'Variable for calculation
    s1 var byte 'Variable s1 holds servomotor #1 pulse width info
    s2 VAR word 'variable for random function
    rv var byte 'variable rv holds the range value
    s1 = 150 'initialize steering servomotor facing forward
    rv = 10 'Adjust as needed for operation
    ct var byte 'counter


    start:
    pot portb.2,255,v1
    pot portb.3,255,v2

    'Check bumper switch "Did I hit something?"
    if porta.0 = 0 then avoid 'Hit obstacle go into avoid mode
    'Is it sleepy time?
    if v1 <= 230 then skp 'Is it dark enough to sleep?
    if v2 > 230 then slp 'Yes

    'Is it too bright to see?
    skp:
    if v1 >= 12 then skip2
    if v2 < 12 then avoid

    'Which way do I go?
    skip2:
    if v1 = v2 then straight
    if v1 > v2 then greater
    if v1 < v2 then lesser

    straight:
    pulsout portb.6, s1
    pulsout portb.7, 157
    goto start

    greater:
    v3 = v1 - v2
    if v3 > rv then right
    goto straight

    lesser:
    v3 = v2 - v1
    if v3 > rv then left
    goto straight

    right:
    s1 = s1 + 1
    if s1 > 225 then s1 = 225
    pulsout portb.6, s1
    pulsout portb.7, 165
    goto start
    left:
    s1 = s1 - 1
    if s1 < 65 then s1 = 65
    pulsout portb.6, s1
    pulsout portb.7, 165
    goto start

    slp:
    pulsout portb.6, s1
    pulsout portb.7, 167
    goto start

    avoid:
    random s2
    s1 = s2 / 256
    if s1 < 65 then s1 = 65
    if s1 > 225 then s1 = 225
    for ct = 1 to 125
    pulsout portb.6, s1
    pulsout portb.7, 177
    pause 18
    next ct

    s1 = 150

    goto start

    I've quoted the code I've posted in one of the previous replies. the program is supposed to make the servomotor #1, which is connected to RB7 stop when in total darkness. I'm confused why the motor still continues on turning even if it is supposed to stop. Please anyone enlighten me on this. Thanks very much!
    Last edited by scaenix; - 19th February 2007 at 08:09.

  9. #49
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I didn't read the whole thing but here's one fast suggestion for you.

    Pulsout have to return the pin to it's previous state right? but nowhere the initial state have been set. When you turn on a PIC, the state of all pin is hard to predict. add those lines at the top of your code.

    Code:
    PORTB=0    ' Clear all PORTB pin
    TRISB=0     ' Set all PORTB pins to output
    if it doesn't work, you could still place a LOW PORTB.7 after each PULSOUT.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  10. #50
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    'Read Cds cell #1 on port b line 1
    'Read Cds cell #2 on port b line 7
    v1 var byte 'Variable v1 holds Cds #1 information
    v2 var byte 'Variable v2 holds Cds #2 information
    .................................................. ..........
    start:
    pot portb.2,255,v1
    pot portb.3,255,v2
    My guess is the values in v1 and v2 are are not as expected. Pot command can be a pain at times. Do you have anyway of sending these values to an LCD to debug?
    Wisdom is knowing what path to take next... Integrity is taking it.
    Ryan Miller

  11. #51
    Join Date
    Oct 2006
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    With the current program, clearing the all PORTB pins and setting them all for output couldn't seem to work since portb.2 and portb.3 are used for storing the Cds values which serve as input. I've tried adding LOW PORTB.7 after each pulsout but it still doesn't work. About the LCD thing, I'll try it when I get to school since that is the only place where the LCD is available. I'll update you when I get the results.

  12. #52
    Join Date
    Oct 2006
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    hmm..can anyone please tell me what command to send to a servo motor -- a modified one for continuous rotation-- in order for it to stop? Thanks!

  13. #53
    Join Date
    Oct 2006
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    Oh well! Howdy! I've finally figured it out. I've figured out how to stop the servo motor and adding a reverse functionality to it. Thanks for the help guys! Thanks very much for all the helpful post. More power to all!

Similar Threads

  1. Endless supply of 'syntax error's.
    By BitHead in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th December 2009, 20:21
  2. Replies: 0
    Last Post: - 1st September 2008, 07:03
  3. Math operations & Syntax?
    By kevj in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 23rd February 2008, 01:40
  4. Need help with I2C syntax problem?
    By Michael Wakileh in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th July 2007, 19:11
  5. Syntax error PIC16F684
    By milestag in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 21st September 2005, 18:54

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts