Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Please correct this pythos script to send data on USB0 port?

#!/usr/bin/env python

from serial import Serial
from time import sleep

class Create:
    """Wrapper class for the iRobot Create"""

    def __init__(self, tty="/dev/ttyUSB0"):
        """constructor for the Create, takes in a single argument: the serial port"""
        self.timeout = 5
        self.port = Serial(tty, 57600, timeout= self.timeout)


    def start(self):
        """Start the Exia after initialization or reset."""

        self.__sendNow(P,0,0,0)
        sleep(1)
        self.__sendNow(V,0,0,100)
        sleep(10)


    def stop(self):
        """Stop the Exia. Must be called before deletion of the iCreate object."""
        self.__sendNow(V,0,0,0)

Please correct this pythos script to send data on USB0 port?

#!/usr/bin/env python

from serial import Serial
from time import sleep

class Create:
    """Wrapper class for the iRobot Create"""

    def __init__(self, tty="/dev/ttyUSB0"):
        """constructor for the Create, takes in a single argument: the serial port"""
         self.timeout = 5
        self.port = Serial(tty, 57600, timeout= self.timeout)


    def start(self):
        """Start the Exia after initialization or reset."""

        self.__sendNow(P,0,0,0)
        sleep(1)
        self.__sendNow(V,0,0,100)
        sleep(10)


    def stop(self):
        """Stop the Exia. Must be called before deletion of the iCreate object."""
        self.__sendNow(V,0,0,0)

/home/admin-pc/mywork/test/scripts/create.py: line 1: This module provides a class wrapping an Exia.: command not found
from: can't read /var/mail/serial
from: can't read /var/mail/time
/home/admin-pc/mywork/test/scripts/create.py: line 6: class: command not found
/home/admin-pc/mywork/test/scripts/create.py: line 7: Wrapper class for the iRobot Create: command not found
/home/admin-pc/mywork/test/scripts/create.py: line 9: syntax error near unexpected token ('<br> /home/admin-pc/mywork/test/scripts/create.py: line 9: def __init__(self, tty="/dev/ttyUSB0"):'

Please correct this pythos script to send data on USB0 port?

#!/usr/bin/env python

from serial import Serial
from time import sleep

class Create:
    """Wrapper class for the iRobot Create"""

    def __init__(self, tty="/dev/ttyUSB0"):
        """constructor for the Create, takes in a single argument: the serial port"""


        self.timeout = 5
        self.port = Serial(tty, 57600, timeout= self.timeout)


    def start(self):
        """Start the Exia after initialization or reset."""

        self.__sendNow(P,0,0,0)
        sleep(1)
        self.__sendNow(V,0,0,100)
        sleep(10)


    def stop(self):
        """Stop the Exia. Must be called before deletion of the iCreate object."""
        self.__sendNow(V,0,0,0)

/home/admin-pc/mywork/test/scripts/create.py: line 1: This module provides a class wrapping an Exia.: command not found
from: can't read /var/mail/serial
from: can't read /var/mail/time
/home/admin-pc/mywork/test/scripts/create.py: line 6: class: command not found
/home/admin-pc/mywork/test/scripts/create.py: line 7: Wrapper class for the iRobot Create: command not found
/home/admin-pc/mywork/test/scripts/create.py: line 9: syntax error near unexpected token ('<br> /home/admin-pc/mywork/test/scripts/create.py: ('/home/admin-pc/mywork/test/scripts/create.py: line 9: def __init__(self, tty="/dev/ttyUSB0"):'

Please correct this pythos python script to send data on USB0 port?

#!/usr/bin/env python

from serial import Serial
from time import sleep

class Create:
    """Wrapper class for the iRobot Create"""

    def __init__(self, tty="/dev/ttyUSB0"):
        """constructor for the Create, takes in a single argument: the serial port"""


        self.timeout = 5
        self.port = Serial(tty, 57600, timeout= self.timeout)


    def start(self):
        """Start the Exia after initialization or reset."""
 
        self.__sendNow(P,0,0,0)
        sleep(1)
        self.__sendNow(V,0,0,100)
        sleep(10)


    def stop(self):
        """Stop the Exia. Must be called before deletion of the iCreate object."""
         self.__sendNow(V,0,0,0)

/home/admin-pc/mywork/test/scripts/create.py: line 1: This module provides a class wrapping an Exia.: command not found
from: can't read /var/mail/serial
from: can't read /var/mail/time
/home/admin-pc/mywork/test/scripts/create.py: line 6: class: command not found
/home/admin-pc/mywork/test/scripts/create.py: line 7: Wrapper class for the iRobot Create: command not found
/home/admin-pc/mywork/test/scripts/create.py: line 9: syntax error near unexpected token ('/home/admin-pc/mywork/test/scripts/create.py: line 9: def __init__(self, tty="/dev/ttyUSB0"):'