Jump to content

pattousai

EstablishedMember
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About pattousai

  • Rank
    Newbrie
  1. Hi, good afternoon to all. Well, in my program i have the following interrupt code: void interrupt( void ){ //Armazena o número digitado temp[k] = (test_bit(portb,1) != 0) + (2 * (test_bit(portb,2) != 0)) + (4 * (test_bit(portb,3) != 0)) + (8 * (test_bit(portb,4) != 0)); if( k < 4 ){ k=k+1; } //Se os 4 digitos tiverem sido digitados, verifica se é a senha if( k == 4 ){ if( senha[0] == temp[0] & senha[1] == temp[1] & senha[2] == temp[2] & senha[3] == temp[3] ){ // bip_ok(); /* for(i=0;i<100;i=i+1){ set_bit(portb,bip); delay_100us( 10 ); clear_bit(portb,bip)
  2. to say te truth i don't really understand what you said. but i guess that the proteus can be very real. by the way, thanks for caring about and i will try to make the code more clear
  3. i'm not sure if i quite understand :/ if you can post a simple part of the code thanks
  4. Hi, could anyone tell me how i make a sound in the pic 16f84a?? i'm not worry to make a specify sound, any bip would fit thanks
  5. Ok. i'm using the pic 16f84a. and i think that the interrupt is really necessary, but that kind of trouble (using the same function twice) i will not have. i write this code: #include <system.h> #pragma CLOCK_FREQ 4000000 #ifdef _PIC16 #pragma DATA 0x2007, _XT_OSC & _WDT_OFF #endif int senha[4]; //stores one predetermined password int temp[4]; //stores the password that is been digited int k; //variable that counts how many digits is been typed bool aux; void interrupt( void ){ if( k<4 ){ temp[k] = (test_bit(portb,1) != 0) + (2 * (test_bit(portb,2) != 0)) + (4 * (t
  6. thank's for your help, but if you can just write a real (functional) code i'll be aprecciate thanks once again
  7. hi, i'm using the boostC compiler, and i'm wondering, is there a simple way to do an interrupt just when the input modify from 0 to 1?? actually, i never do any interrupt, so, if anyone has a simple code just to explain how interrupts goes it will be good enough thanks!!!
×
×
  • Create New...