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
Page9_4
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

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
'*********************
Dim dlay as Integer
'*********************
Sub Procedure DlayVar
dlay = dlay - 1
Vdelay_ms(dlay)
End Sub
'*********************
Sub Procedure scroll  ' Pretty Marquee lights
  PortB = %01001001
  Sound_Play(dlay,20)
  DlayVar
  PortB = %10010010
  Sound_Play(dlay,20)
  DlayVar
  PortB = %00100100
  Sound_Play(dlay,20)
  DlayVar
End Sub
'*********************
Main:
  TrisB = %00000000   ' Configure PortB pins as output
  TrisA = %00000000   ' Configure PortA pins as output
  CMCON = %00000111   ' Stupid Comparitor
  Sound_Init(PortA,0)
  dlay = 200
MainLoop:             ' We could have called it Kansas
  scroll
  If dlay <=25 Then
     PortB = %10000001
     Sound_Play(20,90)
     PortB = %01000010
     Sound_Play(25,90)
     PortB = %00100100
     Sound_Play(50,90)
     PortB = %00011000
     Sound_Play(75,90)
     PortB = %00111100
     Sound_Play(100,90)
     PortB = %01111110
     Sound_Play(150,90)
     PortB = %10000001
     Sound_Play(200,90)
     dlay = 200
  End If
Goto MainLoop
End.
PIC Home Previous Page Next Page Next Chapter

Page: 1 2 3 4

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