Blinking LED will not Blink


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: Blinking LED will not Blink

    Hi

    Thank you…. Pity I couldn't have them all on same line…:-

    D: GOSUB Dash, Dot, Dot

    Or could I ?

    TY Again !!

  2. #2
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: Blinking LED will not Blink

    What PBP do you have?

  3. #3
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: Blinking LED will not Blink

    2.50C

    Thinking of PBP3 Silver but is it that much different…?

  4. #4
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: Blinking LED will not Blink

    Quote Originally Posted by andybarrett1 View Post
    2.50C

    Thinking of PBP3 Silver but is it that much different…?
    With PBP3 you can create user commands so you could have

    D: Dash: Dot: Dot

    which is the only reason I asked.

    With 3 there is arrayread and arraywrite which you could use in this example. But as I am on 2.46 I am in no position to advise.

  5. #5
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: Blinking LED will not Blink

    Ah OK…..

    Maybe stay where I am then :-)

    Arrays are a hole new minefield for me….. Although I am OK with my Antenna Array on the roof. (Radio Ham)

    Whole lot of learning for me yet!

    BR and TY

    Andy

  6. #6
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: Blinking LED will not Blink

    Have a go with gosubs as a start, we can progress to arrays later. I could write examples for you but I believe you will learn more doing it yourself. As always if you need help just ask.

  7. #7
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: Blinking LED will not Blink

    Hi Steve.

    My attempt at using gosubs... First thing I notice is the memory saving. I Know I could improve things by putting all the letters in a table and calling them up....Ideally I would like to be able to use a 24C32 or similar but how do I get the table in there ??

    That way I could have lots more messages !!!

    Anyway... Any suggestions on how to improve on my basics here.

    Thank you

    Andy


    '************************************************* ***************
    '* Name : Morse_beta.BAS *
    '* Author : [select VIEW...EDITOR OPTIONS] *
    '* Notice : Copyright (c) 2014 [select VIEW...EDITOR OPTIONS] *
    '* : All Rights Reserved *
    '* Date : 17/08/2014 *
    '* Version : 1.0 *
    '* Notes : *
    '* : *
    '************************************************* ***************

    TRISA=0 'All A Port outs
    TRISB=0 'All B Port outs
    CMCON=7

    LED VAR PORTB.0 'LED Indicator

    Mess: pause 2000

    High led
    pause 5000 'Led on for 5 seconds
    low led
    pause 2000 'off for 2 seconds

    begin:
    m: gosub dash : gosub dash : gosub lgap
    o: gosub dash : gosub dash : gosub dash : gosub lgap
    s: gosub dot : gosub dot : gosub dot : gosub lgap
    t: gosub dash : gosub lgap
    l: gosub dot : gosub dash : gosub dot : gosub dot : gosub lgap
    y: gosub dash : gosub dot : gosub dash : gosub dash : gosub lgap

    spc: gosub space

    h: gosub dot : gosub dot : gosub dot : gosub dot : gosub lgap
    a: gosub dot : gosub dash : gosub lgap
    r: gosub dot : gosub dash : gosub dot : gosub lgap
    mm: gosub dash : gosub dash : gosub lgap
    ll: gosub dot : gosub dash : gosub dot : gosub dot : gosub lgap
    e: gosub dot : : gosub lgap
    ss: gosub dot : gosub dot : gosub dot : gosub lgap
    sss: gosub dot : gosub dot : gosub dot : gosub lgap


    pause 3500 '3.5 sec delay

    goto mess

    dash: high led 'dash
    pause 1500
    low led
    pause 500
    return

    dot: high led 'dot
    pause 500
    low led
    pause 500
    return

    lgap: pause 1000 'letter gap
    return

    spaceause 1000 'space
    return



    end

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Blinking LED will not Blink

    Quote Originally Posted by andybarrett1 View Post
    Hi

    Thank you…. Pity I couldn't have them all on same line…:-

    D: GOSUB Dash, Dot, Dot

    Or could I ?

    TY Again !!
    From the book...
    4.13. Multi-statement Lines

    In order to allow more compact programs and logical grouping of related commands, PBP supports the use of the colon ( to separate statements placed on the same line. Thus, the following two examples are equivalent:

    W2 = W0
    W0 = W1
    W1 = W2

    is the same as:

    W2 = W0 : W0 = W1 : W1 = W2

    This does not, however, change the size of the generated code.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Simple Blinking LED - WTF!!
    By johnnylynx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st February 2010, 06:19
  2. PIC16F819 LED not blinking
    By ronbowalker in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 1st December 2009, 02:04
  3. blinking LED
    By kindows in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 31st July 2009, 16:08
  4. PIC18f452 blinking led ?
    By iugmoh in forum General
    Replies: 5
    Last Post: - 7th March 2008, 14:12
  5. Why is my LED not blinking?
    By Gary Goddard in forum General
    Replies: 14
    Last Post: - 1st January 2007, 20:23

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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