When verifying the code it works but when I try to upload it I get this error messsage:
Arduino: 1.6.7 (Mac OS X), Board: "Arduino/Genuino Uno"
Sketch uses 3,042 bytes (9%) of program storage space. Maximum is 32,256 bytes.
Global variables use 42 bytes (2%) of dynamic memory, leaving 2,006 bytes for local variables. Maximum is 2,048 bytes.
avrdude: ser_open(): can't open device "/dev/cu.usbmodem1421": No such file or directory
ioctl("TIOCMGET"): Inappropriate ioctl for device
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.