PicBasic SERIN


Closed Thread
Results 1 to 2 of 2

Thread: PicBasic SERIN

  1. #1
    Join Date
    Dec 2009
    Posts
    6

    Default PicBasic SERIN

    Hello!

    How to turn on LED with PIC16F84A when I send some date from computer

    So, how to use the command SERIN?

    Thanks!

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hello Azra01,
    UnTested Sample:
    Code:
    PortA = %00000000 'all outputs low
    PortB = %00000000 'all outputs low
    TrisA = %00000000 'All as outputs
    TrisB = %00000001 ' B.0 as input all others as outs
    
    
    include"modedefs.bas" ' includes aliases for modes
    b0    var byte
    dummy var byte
    mainloop:
    
    'from the manual except I named the port to be used <> 1
    serin PortB.0, n2400,["A"],B0 'waits for ASCII A then saves next data
    ' not exactly from the manual but close
    branch B0, [dog, cat, fish, mainloop] 'same as if then spaghetti
    
    dog: 'here is where the work gets done, in the subs
    porta.0 = 1
    goto mainloop
    
    cat:  'here is where the work gets done, in the subs
    porta.0 = 0
    goto mainloop
    
    fish:   'here is where the work gets done, in the subs
    for dummy = 0 to 9
    portb.1=1
    pause 500
    portb.1 = 0
    pause 500
    next dummy
    
    goto mainloop
    So send out an ASCII "A" and the number 1 and it jumps to DOG
    A and 2 ,and it jumps to CAT . . .
    EDIT: just checked it, compiles . . . should run . . .
    Last edited by Archangel; - 9th January 2010 at 02:13.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Serin picbasic
    By azra01 in forum General
    Replies: 8
    Last Post: - 18th December 2009, 22:38
  2. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  3. Problem with PBP interrupt and Serin, please help
    By rgregor in forum mel PIC BASIC
    Replies: 0
    Last Post: - 22nd August 2006, 19:02
  4. SerIn and SerOut
    By Dwayne in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 21st July 2004, 15:54
  5. PicBasic Fundamentals
    By Billyc in forum General
    Replies: 9
    Last Post: - 4th May 2004, 10:04

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