6 Buttons


Closed Thread
Results 1 to 4 of 4

Thread: 6 Buttons

  1. #1
    Join Date
    Jun 2007
    Posts
    7

    Default 6 Buttons

    Hi,

    I need to complile a program with 6 buttons lets say it's connected from portb0-5. When the user press button 1345 the code must send out serial 134&5. I'm still new with picbasic and I just don't know where to start?


    Any help
    Thanks

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Johansch View Post
    Hi,

    I need to complile a program with 6 buttons lets say it's connected from portb0-5. When the user press button 1345 the code must send out serial 134&5. I'm still new with picbasic and I just don't know where to start?


    Any help
    Thanks
    Start with hooking up some buttons and getting an LED to respond to a button press...

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


    Did you find this post helpful? Yes | No

    Default

    a bit far of what you need to do... but you may find some tricks in it...

    Combination Gate Access
    http://www.picbasic.co.uk/forum/show...=gate+operator

    Enjoy!
    Steve

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

  4. #4
    Join Date
    Jun 2007
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Thanks for that many info, but I think that is way over my head I'm only in my second week in picbasic and also doing it part time.
    The code I started is like this for 4 buttons
    Include "16f84a.inc"

    Key1 var byte
    Key2 var byte
    Key3 var byte
    Key4 var byte

    Start: if portb.0 = 1 then key1 = 0
    if portb.1 = 1 then key2 = 1
    if portb.2 = 1 then key3 = 2
    if portb.3 = 1 then key4 = 3
    if porta.0 = 1 then Sout
    goto start
    Sout:
    high 7
    serout porta.4,N2400,[#key1,#key2,#key3,#key4]
    clear
    goto start

    I did use the button function and I get the same result as the one above, the problem is that the code do send serout 0123 format, yes I know I set that up that way for serout, but I need to send it out in the sequence the buttons was pressed say for example 0231 or lets say there was a button that was pressed twice "0122", this is where I don’t know how to set that up

    Thanks for all the help !

Similar Threads

  1. 6 MHz Osc and PauseUSL errors
    By vk2tds in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 31st August 2007, 05:04
  2. Real Time Clock & Eeprom
    By smart_storm in forum General
    Replies: 8
    Last Post: - 17th February 2006, 19:03
  3. Output PIC module
    By freelancebee in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th September 2005, 20:10
  4. 6 random numbers limiting to 49 ?????
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 15th June 2005, 23:27
  5. '877 and Visual Basic 6
    By Tomas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th March 2004, 02:31

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