dumb question


Closed Thread
Results 1 to 40 of 94

Thread: dumb question

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Posts
    56


    Did you find this post helpful? Yes | No

    Default

    Thank you!

  2. #2
    Join Date
    Aug 2009
    Posts
    56


    Did you find this post helpful? Yes | No

    Default

    I have compiled this and dont know why only 3 LEDs are blinking and the 4th doesnt blink.Could you tell me where I am mistaken,to understand better.Thank you
    Code:
    '****************************************************************
    '*  Name    : P16F690.INC                                       *
    '*  Author  : [osceola]                                         *
    '*  Notice  :                                                   *
    '*          : All Rights Reserved                               *
    '*  Date    : 25/08/2009                                        *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    ' PICBASIC PRO program to blink 3 LEDS in sequence
    
    ' Define LOADER_USED to allow use of the boot loader.
    ' This will not affect normal program operation.
    Define	LOADER_USED	1
    DEFINE OSC 4           'This is the default setting
    OSCCON=%01100000
    @ device  pic16F690, intrc_osc_noclkout, wdt_on, mclr_on, protect_off
    i       Var     Byte		' Define loop variable
    LED1    VAR PORTC.0
    LED2    VAR PORTC.1
    LED3    Var PORTC.2
    LED4    VAR PORTC.3
    LEDS    Var     PORTC
    
    	TRISC = %00000000       ' Set PORTC to all output
    
    mainloop:  
            LEDs = 1
            Pause 500	
            LEDS = 2
            Pause 500	
            LEDS = 3		
            Pause 500		'
            LEDS = 4		
            Pause 500		' Delay for .5 seconds
            For i = 1 To 4          ' Go through For..Next loop 2 times
                    LEDS = LEDS << 1        ' Shift on LED one to left
                    Pause 500       ' Delay for .5 seconds
            Next i
    
            Goto mainloop		' Go back to mainloop and blink LED forever
    
            End

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


    Did you find this post helpful? Yes | No

    Default

    Decimal 4 equals what in Binary?

    That brings us back to:
    what does this do?
    Code:
    PORTC = %11100000
    you have it in one of your codes.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Aug 2009
    Posts
    56


    Did you find this post helpful? Yes | No

    Default

    Decimal 4 in Binary is 100.Sorry but dont understand,you said nothing about decimal to bynari conversions

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by osceola View Post
    Decimal 4 in Binary is 100.Sorry but dont understand,you said nothing about decimal to bynari conversions
    You are correct on bothe accounts. It is 100 and I did not say anything about conversions. But you put LEDS = 4 in your code and I have asked you twice about a other line you wrote and you have not answered.

    And you have not shown any attempts using the button on your demo board as an input.

    You said you wanted to learn. Have you been studying the PICs data sheet and the Pic Basic manual? It looks to me like you have not.

    So what do you really want? Do you want to learn or have someone write your code for you?
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Aug 2009
    Posts
    56


    Did you find this post helpful? Yes | No

    Default

    I dont want to be rude,sorry,but seems hard to me or I am really dumb and dont understand.I have a code witch I find on Microchip website,just want to modify it to write data to EEPROM-and for that I have to learn a lot,I have less then 2 weeks remain to present the project and Im going out of time...As you said,would be easy if somebody write the code,but I dont know who will do that,maybe somebody who wants to help me

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


    Did you find this post helpful? Yes | No

    Default

    So this is a project for school and you want someone to do the work for you?

    That is not what we do here. Sorry.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. AN Question for "word" variable read The serial port
    By redfoen in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th December 2007, 17:39
  2. really simple, dumb question
    By picster in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd March 2007, 22:02
  3. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 09:45
  4. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 06:49
  5. Dumb question
    By Christopher4187 in forum General
    Replies: 0
    Last Post: - 20th June 2006, 12:02

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