Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C by registered user freddyzepeda26 ( 10 years ago )
// Tinaco y Bomba de agua
// Zepeda Hernández Jesús Alfredo
void configuracion();
int cuenta = 1;
void main() {
configuracion();
while(1){
PORTD=~PORTB;
if(PORTB.RB1 == 1 || (PORTB.RB1 == 0 && PORTB.RB0 == 1)){
if(PORTB.RB4 == 0 && PORTB.RB3 == 0 || PORTB.RB2 == 0){
cuenta++;
if(cuenta%2 == 0){
while(PORTB.RB0 == 1){
PORTD.RD5 = 1;
PORTD.RD6 = 0;
delay_ms(3);
PORTD=~PORTB; }}
else {
while(PORTB.RB0 == 1){
PORTD.RD5 = 0;
PORTD.RD6 = 1;
delay_ms(3);
PORTD=~PORTB; }}
}
}
}
} //Cierra void
void configuracion(){
TRISD = 0x00; //Parte del Puerto D como salida
ANSELH = 0x00; //Configurando como entradas digitales
TRISB = 0b00011111;
OPTI & 0x7F; // Resistencias pull-up
PORTB = 0xFF; }
Revise this Paste