while(1){ if (input(pin_a0)) output_high(pin_a1);}
#include <16F84.h>#FUSES NOWDT //No Watch Dog Timer#FUSES HS //Crystal osc <= 4mhz for PCM/PCH , 3mhz to 10 mhz for PCD#FUSES PUT //Power Up Timer#FUSES NOPROTECT //Code not protected from reading#use delay(clock=8000000)void main(){ while(true){ if(input(pin_a0)) output_high(pin_b7); }
naisip ko lang habang naliligo ako... pwede ko bang gamitin as one of the regular switches ang reset pin. healthy ba ito sa part ng MCU...?
At any point puwede mong gamitin ang reset PIN ng MCU. Ganito lang naman yan eh. Kahit saan nakaturo ang program pointer mo whenever you insert a call for the MCLR reset ay babalik lang sa simula ng program mo ang program pointer, in other words, uulit lang ang program mo from where it starts.-underpazz campaigns for more technical post on technical threads-underpazz campaigns for "no hijack policy" on technical sections
yup ok lang 'yun. parang mga gaming consoles 'yan tulad ng Family Computer, nakakabit ang reset. kung meron kang gustong gawin kapag nag-reset, doon ilalagay sa bago mag-infinite loop. meron ding mga MCU na pwede mong i-check kung ano ang source ng reset kaya pwede mo ring gawan sa program ng conditional statement.other MCU's have NMI (Non-Maskable Interrupt) on reset pins. may pupuntahang Interrupt tapos hindi niya buburahin lahat ng laman ng memory. kaya pwede na talagang gamitin as input 'yung reset.
hehehe.