New device warns of heart attacks