C to PICbasic


Closed Thread
Results 1 to 3 of 3

Thread: C to PICbasic

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,172


    Did you find this post helpful? Yes | No

    Default

    Sorry only Basic here!

    Look for the C forum of your compiler.

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default

    Should be something like
    Code:
    C var byte
    TRISB = 0
    PORTB = 0
    
    Main
    	gosub blink_redgreen
    	gosub blink_baf
    	gosub alt_blink
    	gosub blink_sequence
    	goto Main
    
    
    pause_action:
    	pause 500 ' arbitrary delay... 500 mSec here
    	return
    
    
    blink_redgreen:
    	for c=0 to 9
    		PORTB = %10101010
    		gosub pause_action
    		PORTB = %01010101
    		gosub pause_action
    
    		next
    	return
    
    blink_baf:
    	for c=0 to 9
    		PORTB = %10100101
    		gosub pause_action
    		PORTB = %01011010
    		gosub pause_action
    		next
    	return
    
    alt_blink:
    	for c=0 to 9
    		PORTB = %10011001
    		gosub pause_action
    		PORTB = %01100110
    		gosub pause_action
    		next
    	return
    
    blink_sequence:
    	for c=0 to 9
    		PORTB = %10010101
    		gosub pause_action
    		PORTB = %01100101
    		gosub pause_action
    		PORTB = %01011001
    		gosub pause_action
    		PORTB = %01010110
    		gosub pause_action
    		next
    	return
    Steve

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

Similar Threads

  1. How to configure SPI in PICBASIC PRO?
    By moogle in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th April 2007, 19:31
  2. Picbasic VS C Compiler
    By koossa in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 11th October 2005, 22:44
  3. Replies: 22
    Last Post: - 12th July 2005, 18:39
  4. PicBasic Fundamentals
    By Billyc in forum General
    Replies: 9
    Last Post: - 4th May 2004, 11:04
  5. PicBasic Pro & PicBasic syntax different
    By Billyc in forum General
    Replies: 5
    Last Post: - 16th April 2004, 22:19

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