Code error causing me to lose Arduino (Micro) boards (when uploading code)

I am a beginner to programming but i feel confident in all my connections (i have some wiring experience from when i working HVAC). i wired temp sensor>>>pinA0 and purple wire from pulse sensor>>>pinA1.

i guess i could have a defective pulse sensor (but i doubt it bc light turns on and everything seems fine).

when i say " i lost 2 boards" i mean they stopped communicating with the computer. the computer says the device is not working properly (after connecting usb or resetting). the green lights on the boards contiune to pulsate when i press reset or connect the cable (and the blue lights work too).. i just cant seem to get it to work properly (it wont show under com anymore). i have tried resetting the board while uploading a new code and nothing.