Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <16F886.h>
- #device ADC=10 *=16
- #FUSES NOWDT //No Watch Dog Timer
- #FUSES PUT //Power Up Timer
- #FUSES NOMCLR //Master Clear pin not enabled
- #FUSES NOPROTECT //Code not protected from reading
- #FUSES NOCPD //No EE protection
- #FUSES BROWNOUT //Brownout reset
- #FUSES IESO //Internal External Switch Over mode enabled
- #FUSES FCMEN //Fail-safe clock monitor enabled
- #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
- #FUSES NODEBUG //No Debug mode for ICD
- #FUSES NOWRT //Program memory not write protected
- #FUSES BORV40 //Brownout reset at 4.0V
- #FUSES RESERVED //Used to set the reserved FUSE bits
- #FUSES INTRC_IO
- #use delay(clock=8M)
- #use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
- #define RUN_BUTTON PIN_B7
- int counter=0;
- #INT_RB
- #INT_TIMER1
- void timer1_isr(){
- set_timer1(63936);
- counter=1;
- // ?????????????? ISR ???? ?????????????????????
- }
- //!int i =0;
- void main() {
- int a=0,b=0;
- // ?????????? = 100 ms
- setup_timer_1(T1_INTERNAL | T1_DIV_BY_1);
- set_timer1(63936);
- enable_interrupts(INT_TIMER1);
- enable_interrupts(GLOBAL);
- while (1) {
- if (input(PIN_A2)){//left button
- output_high(PIN_B2);
- delay_ms(250);
- output_low(PIN_B2);
- //rotated left
- }if (input(PIN_A3)){//left button
- output_high(PIN_B1);
- delay_ms(250);
- output_low(PIN_B1);
- //rotated left
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement