Carbon-based nanoelectromechanical devices