If dip1 = 1 and dip2 = 1 and dip3 = 1 and dip4 = 1 then
pause 8000
else
if dip1 = 0 etc.
endif
or
something var byte
something = porta &%00111100
if something = 60 then
pause 8000
else
if something = etc.
endif
If dip1 = 1 and dip2 = 1 and dip3 = 1 and dip4 = 1 then
pause 8000
else
if dip1 = 0 etc.
endif
or
something var byte
something = porta &%00111100
if something = 60 then
pause 8000
else
if something = etc.
endif
It might help if someone knew what DIL 18 was.
it's a 18 pins device with a DIL packageI'll bet it's a black one
![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Some are dark brown. Some even have writing on them - I wonder what this one is?
Another clueless student trying to fudge a class project by the looks of it.
Yes it's 16F88 .. and it's 18pin... BLACK in color comes with some wording on top of it!! but I use my finger's to rub it off anyway.. and now it's unknown chips , so I put DIL18
Thanks mat janssen , this is what I've done first... I'm sure somewhere must have coded wrongly.. I'll check tonite again!
Thanks!
Something like this is where LOOKUP2 comes in handy.
Change the delay periods in the table to suite your app.Code:@ DEVICE PIC16F88, WDT_OFF,INTRC_OSC,MCLR_OFF,BOD_ON,LVP_OFF,PWRT_ON,PROTECT_OFF DEFINE OSC 8 DEFINE NO_CLRWDT 1 OSCCON = %01110000 ' 8MHz CMCON = 7 ' disable analog comparators ANSEL = 0 ' disable A/D module, all digital X VAR WORD Index VAR BYTE LED VAR PORTB.0 TRISA = %00111100 ' RA2 to RA5 inputs for DIP switch PORTB = 0 TRISB = %11111110 ' RB0 for LED OPTION_REG = %11111111 WHILE OSCCON.2 = 0 ' wait for internal osc stable before moving on WEND Main: Index = (PORTA >> 2) & $0F ' Read DIP switch AND mask result LOOKUP2 Index,[200,300,400,500,600,700,800,900,1000,2000,_ 3000,4000,5000,6000,7000,8000],X HIGH LED PAUSE X LOW LED PAUSE X GOTO Main END
Thanks Bruce!
your code helps alot, and it looks much simpler then what I've done... thanks again!
Bookmarks