How do microcontrollers work
Data received from input device which gets stored temporarily in the microcontrollers ram
cpu then acts upon this data according To a programs instructions stored in flash memory
a signal is send to an output device to carry out an appropriate action