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
Page1
Home Product Catalog Shopping Cart Resources Links
Code Page Policies Gallery

Counting Down with a PIC16F628(A)

PIC Home Previous Page Next Page Next Chapter

Page: 1

Believe it or not, it is the exact same circuit.

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!
'*********************
Dim value as Byte
'*********************
Sub Procedure Dlay100
Delay_ms(100)
End Sub
'*********************
Main:
     TrisB = %00000000 'Configure Pins of PortB as Output
     value = 255       'Start code off with a value = 255
Count_Dwn:
     PortB = value     'Send value to PortB
     Value = value - 1 'Subtract one to Value
     If value = 0 Then 'If value is equal to 255 then....
        value = 255    'Value switches back to 255
     End if            'Always end an If statement with an End If
     Dlay100           'Call the Dlay100 sub procedure
Goto Count_Dwn         'Jump back up to the Count_Dwn Section
End.                   'All good things must end
'*********************
PIC Home Previous Page Next Page Next Chapter

Page: 1

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