How to disable/enable only pin change interrupt - robot?


hello all!

i'm making robot mega 2560 stores path sdcard.
i have 2 encoders on wheels - left , right (pins 2 , 18).
the problem if interrupt encoders occurs during sdwrite time file corrupts.

i wanna disable interrupts both pins, perform write on sd , enable again. no problem if lost pulses.

can me?

thanks!

can me?
a question without code can answered answer without code.

you have disable interrupts while writing sd card.  turn pin change interrupts off, write sd, , turn pin change interrupts on. 

how did turn them on in first place?  did hit bits in register enable them or using 1 of libraries working pin change interrupts?

why don't use hardware interrupts?  can detachinterrupt , attachinterrupt in places want turn them off , on.


Arduino Forum > Using Arduino > Programming Questions > How to disable/enable only pin change interrupt - robot?


arduino

Comments