⚡ Descuentos en cursos en video - Lleva tu aprendizaje técnico al siguiente nivel y aprovecha precios especiales antes de que termine la oferta. 🔥 Aprovechar oferta ahora 🔥
Microcontroladores y sistemas digitales

como prender y apagar tres led con un pulsador

eddyjosepeñamolina
hace 9 años
hace 9 años
ya logro prender y apagar un led con un pulsador ahora me gustaría aprender y apagar tres led de manera secuencial con un pulsador ej que al presionar 1 vez encienda el primer led, la segunda vez el segundo led pero sin pagar el otro, la tercera vez el tercer led sin apgar los otros dos, y la cuarta vez se apagan los 3 led
henmope
henmope
161
hace 9 años
hace 9 años
Sencillo, Eddy una forma sería: trisa=%000000 trisb=%11111111 inicio: IF portb.0=0 then inicio ;bucle escanea el botón porta=%000001 ;boton fué pulsado prende 1er. led inicio2: IF portb.0=0 then inicio2 ;bucle escanea de nuevo el botón porta=%000011 ;boton fué pulsado prende 2do. led y deja encendido el1° inicio3: IF portb.0=0 then inicio3 ;bucle escanea de nuevo el botón porta=%000111 ;boton fué pulsado prende 3er. led y deja encendido 1y2 inicio4: IF portb.0=0 then inicio4 ;bucle escanea de nuevo el botón porta=0 ;boton fué pulsado apaga todos los leds goto inicio ;comienza de nuevo end
Carlos Andrade2016
hace 9 años
hace 9 años
Amigo henmope Quise hacer ese programa porque mi práctica es igual pero me sale error y no puedo compilar me puedes ayudar? Me imprime este error [code:1]CLEAN SUCCESSFUL (total time: 265ms) make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf make[1]: Entering directory 'C:/Users/coompaq/Documents/Borre/MPLABpracticas/MICROCONTROLADOR.X' make -f nbproject/Makefile-default.mk dist/default/production/MICROCONTROLADOR.X.production.hex make[2]: Entering directory 'C:/Users/coompaq/Documents/Borre/MPLABpracticas/MICROCONTROLADOR.X' make[2]: *** [build/default/production/practica_dos.o] Error 1 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2 "C:\Program Files\Microchip\MPLABX\v3.40\mpasmx\mpasmx.exe" -q -p16f84a -l"build/default/production/practica_dos.lst" -e"build/default/production/practica_dos.err" -o"build/default/production/practica_dos.o" "practica_dos.asm" Warning[205] C:\USERS\COOMPAQ\DOCUMENTS\BORRE\MPLABPRACTICAS\MICROCONTROLADOR.X\PRACTICA_DOS.ASM 4 : Found directive in column 1. (LIST) Error[128] C:\USERS\COOMPAQ\DOCUMENTS\BORRE\MPLABPRACTICAS\MICROCONTROLADOR.X\PRACTICA_DOS.ASM 9 : Missing argument(s) Error[128] C:\USERS\COOMPAQ\DOCUMENTS\BORRE\MPLABPRACTICAS\MICROCONTROLADOR.X\PRACTICA_DOS.ASM 10 : Missing argument(s) Error[150] C:\USERS\COOMPAQ\DOCUMENTS\BORRE\MPLABPRACTICAS\MICROCONTROLADOR.X\PRACTICA_DOS.ASM 12 : Labels must be defined in a code or data section when making an object file Warning[205] C:\USERS\COOMPAQ\DOCUMENTS\BORRE\MPLABPRACTICAS\MICROCONTROLADOR.X\PRACTICA_DOS.ASM 13 : Found directive in column 1. (IF) Error[113] C:\USERS\COOMPAQ\DOCUMENTS\BORRE\MPLABPRACTICAS\MICROCONTROLADOR.X\PRACTICA_DOS.ASM 13 : Symbol not previously defined (portb) Error[108] C:\USERS\COOMPAQ\DOCUMENTS\BORRE\MPLABPRACTICAS\MICROCONTROLADOR.X\PRACTICA_DOS.ASM 13 : Illegal character (=) Warning[212] C:\USERS\COOMPAQ\DOCUMENTS\BORRE\MPLABPRACTICAS\MICROCONTROLADOR.X\PRACTICA_DOS.ASM 32 : Expected (ENDIF) nbproject/Makefile-default.mk:101: recipe for target 'build/default/production/practica_dos.o' failed make[2]: Leaving directory 'C:/Users/coompaq/Documents/Borre/MPLABpracticas/MICROCONTROLADOR.X' nbproject/Makefile-default.mk:84: recipe for target '.build-conf' failed make[1]: Leaving directory 'C:/Users/coompaq/Documents/Borre/MPLABpracticas/MICROCONTROLADOR.X' nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed BUILD FAILED (exit value 2, total time: 1s) [/code:1]
henmope
henmope
161
hace 9 años
hace 9 años
CARLOS , observe como queda
henmope
henmope
161
hace 9 años
hace 9 años
codigo en pbp
henmope
henmope
161
hace 9 años
hace 9 años
henmope
henmope
161
hace 9 años
hace 9 años
henmope
henmope
161
hace 9 años
hace 9 años
para ver la imagen completa, click derecho/abrir imagen en pestaña nueva
Carlos Andrade2016
hace 9 años
hace 9 años
Muchas gracias amigo Henry me fue muy útil, estoy seguro que aprenderé mucho en este foro.
henmope
henmope
161
hace 9 años
hace 9 años
Vale, suerte

¿Conoces una solución?

¡Aprende a reparar con estos cursos YoReparo!

4.84
(25)

Curso Práctico de Reparación y Bobinado de Motores Eléctricos

Héctor Castiñeira
$ 60 USD
$ 20 USD
4.73
(22)

Curso Reparación de Fuentes Conmutadas de PC y Equipos Electrónicos

Maximiliano Resch
$ 40 USD
$ 20 USD
4.64
(11)

Curso Electrónica para Reparación de Placas

Santiago Cediel
$ 29 USD
$ 11 USD
¿Tienes una mejor respuesta a este tema? ¿Quieres hacerle una pregunta a nuestra comunidad y sus expertos?
Regístrate gratis