Resistive switches based on piezoelectric nanowires allow electrical signals to be produced from mechanical actions