PIC BASIC Compiler pbc:- Help!


Closed Thread
Results 1 to 6 of 6
  1. #1
    timmoore47's Avatar
    timmoore47 Guest

    Default PIC BASIC Compiler pbc:- Help!

    This is NOT the pro version. Its v 1.45

    So far I've got this working for a 18F84A, using Micro Code Studio, however this is Day0 and I'm struggling. Code:-

    Loop:

    goto loop
    end


    Now it's easy to spot this does nothing useful. What I'm trying to do is import data from a bunch of switches and output to leds on port b.

    Internet searches etc etc etc have yielded nothing useful for this product in the way of documention. Whilst I bought it yesterday as a download, all the docs folder has was pdf files of the chips themselves, so I am stuck!

    (Update:- Since I posted this, I found http://www.melabs.com/resources/pbcmanual/ which looks OK. ) But just declating variable A ,B , C etc at the beginning of the program... well... the sytax has so far eluded me.....

    Any code fragments or sources of beginners information as to how to get this, no doubt, fine product to do anything useful would be VERY gratefully appreciated!



    Tim
    Last edited by timmoore47; - 18th May 2006 at 20:05.

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Default

    Tim,

    Have a look here

    http://www.melabs.com/resources/samples.htm

    Toward the bottom, there is a section called - PICBASIC™ Compiler

    Start with Blink

    Good Luck,

    Paul Borgmeier
    Salt Lake City, Utah
    USA

  3. #3
    timmoore47's Avatar
    timmoore47 Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by paul borgmeier
    Tim,

    Have a look here

    http://www.melabs.com/resources/samples.htm

    Toward the bottom, there is a section called - PICBASIC™ Compiler

    Start with Blink

    Good Luck,

    Paul Borgmeier
    Salt Lake City, Utah
    USA
    Many thanks, worked a treat but doesn't cover inputing data from portA or logical operators for data decisions. But it's a neat step forward.



    Tim

  4. #4
    mramos's Avatar
    mramos Guest


    Did you find this post helpful? Yes | No

    Default

    Timmoore47:

    You will want to map port A and port B with the "symbol" command like:

    Symbol PortA = 5

    Then read it:

    peek PortA,B0 'read PortA into Byte0 variable

    If the LEDS are on port B, then map PortB with Symbol and Poke PortB,B0

    Note the number of pins on PortA, you might not need to wire LEDs to all of port B.

  5. #5
    timmoore47's Avatar
    timmoore47 Guest


    Did you find this post helpful? Yes | No

    Default

    Thank you. I'll try that out.



    Tim

  6. #6
    Join Date
    Jan 2007
    Posts
    78


    Did you find this post helpful? Yes | No

    Default

    Hi timmoore47,
    How many switches?

    I use 2 approaches.

    If I have plenty of pins to use, I prefere binary switching to a pic as its fast and easy to implement.

    If I am short of pins, I use POT or A/D.
    For Pics that don't have A/D, I use the POT command.
    I set up buttons in a resistive divider ladder.
    Then I have the PIC talk to my PC serialy.
    I press each button to see what the pic is getting for POT or A/D readings and then using those values, the next step is to code where to go in the rest of the program, based on these readings.
    Hope this helps
    dw_picbasic

Similar Threads

  1. PIC BASIC Compiler for ARM machines?
    By stone20008 in forum General
    Replies: 2
    Last Post: - 22nd August 2008, 07:14
  2. using AND as an IF statement
    By dw_pic in forum mel PIC BASIC
    Replies: 27
    Last Post: - 8th June 2006, 18:05
  3. Replies: 5
    Last Post: - 17th January 2006, 19:26
  4. PIC Basic Pro Compiler
    By iclok in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 25th November 2005, 03:22
  5. How to learn PIC BASIC compiler in 7 days?
    By luqman83salleh in forum General
    Replies: 2
    Last Post: - 13th August 2004, 14:15

Members who have read this thread : 1

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