ROBODYSSEY SYSTEMS LLC
Product Catalog
Code Page
Policies
Gallery
Whats New
Press Releases
Resources
Links
Contact Us
About Us
Press
Educators Page
BasicX and Robotics book
After School
Mini Challenge!
Free Robots to Kids
Hack-A-Toy
Shopping Cart
Page11_17
Home Product Catalog Shopping Cart Resources Links
Code Page Policies Gallery

The Bomb with a PIC16F628(A)

PIC Home Previous Page Next Page Next Chapter

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

You are ready to program

Copy and Pastable code


Be sure to create a new project first.
For a review of creating projects please go here
Paste BELOW your program name!
PROGRAM NAME CREATED VIA NEW PROJECT!!
COPY AND PASTE FROM NEXT LINE DOWN
'***********************************************
Sub Procedure Forward
    PortB = %00000000
    Delay_ms(5)
    PortB = %00101101
    Delay_ms(50)
end sub
'***********************************************
Sub Procedure Reverse
    PortB = %00000000
    Delay_ms(10)
    PortB = %00110011
    Delay_ms(50)
end sub
'***********************************************
Sub Procedure T_Left
    PortB = %00000000
    Delay_ms(10)
    PortB = %00101011
    Delay_ms(50)
end sub
'***********************************************
Sub Procedure T_Right
    PortB = %00000000
    Delay_ms(10)
    PortB = %00110101
    Delay_ms(50)
end sub
'***********************************************
Sub Procedure Halt
    Delay_ms(50)
    PortB = %00000000
end sub
'***********************************************
Main:
    TrisB = %00000000    ' Configure pins of PortB as output
    TrisA = %00000000    ' Configure pins of PortA as output
mainloop:
    Forward
    	Delay_ms(5000)
    Halt
    	Delay_ms(1000)
    Reverse
   	  Delay_ms(5000)
    T_Left
    	Delay_ms(3000)
    T_Right
    	Delay_ms(3000)
Goto mainloop
End.
PIC Home Previous Page Next Page Next Chapter

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Robodyssey and the Robodyssey logo are trademarks of Robodyssey Systems, LLC
PIC is a registered trademark of Microchip Technology Inc. in the U.S. and other countries.
MikroBasic is a registered trademark of mikroElectronika Inc. in the U.S. and other countries.
Home Product Catalog Shopping Cart Resources Links
Code Page Policies Gallery