My problem is this, I just bought a MacBook Pro computer, I used to use Windows 10 to do Python practices, connecting it to Arduino using the Pyserial
which was included in the Pycharm
program. Now that I am suando Mac the program Pycharm
does not recognize me the port that identifies me as arduino, in this case it is:
"/ dev / cu.usbmodem1421"
At the time of compiling, I get the following error:
"SyntaxError: Non-ASCII character '\xc2' in file
/Users/StoomBassCow/PycharmProjects/untitled1/aperro/holamundo.py on line 4,
but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details"
Someone who can explain to me what the problem is?
My code is:
# -*- coding: utf-8 -*-
import sys
print sys.getdefaultencoding()
import serial
puertoserie = serial.Serial('/dev/cu.usbmodem1421',9600)
while True:
tecla = input("Presiona la tecla 1 para encender el led")
if tecla.lower() == 'e':
puertoserie.write(b'e')
else:
puertoserie.write(b'a')