Debounce mit PIC 18F und C Compiler

Gast #849809
Lesenswert?

Hallo Zusammen,
ich habe probleme mit der Entprellung. ich habeite mit interrupt und 
Timer und die ergebnis sind nicht gut deshalb wurde mir empfehlen mit 
Entprellung zu arbeiten. ich arbeite mit µC PIC18F in MPLAB und compiler 
C. ich habe sowas gebastelt aber es funktionniert noch nicht

#include <p18F4550.h>
#include <stdio.h>
#include <delays.h>
#include "test.h"

char Debounce( volatile unsigned char PORTXbits,volatile unsigned char 
PORTXbits1)
     {
      if(!(PORTXbits &(1<< PORTXbits1)))
      {
          Nop();
          Nop();
       if(!(PORTXbits &(1<< PORTXbits1)))
         {
           Nop();
           Nop();
           return 1;
         }
    }
     return 0;
   }

und
Gast #849848
Lesenswert?

@ rapeur

Wo ist dein kompletter Code ?
Das was du oben gepostet hast kann man
nicht als komplett bezeichnen. Eher als Schrott.

Und was soll jetzt das posten in der Codesammlung ?
Fragen gehören hier nicht hin.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren