예제 #1
0
def arduinoShellPrompt():
	"""docstring for arduinoShellPrompt"""
	arduino = ArduinoShell("/dev/tty.usbserial-A80081qe")
	arduino.promptLoop()
예제 #2
0
		
	def handleRead(self):
		"""docstring for handleRead"""
		print "Reading: ", self.board.readLine()

	def handleWrite(self):
		"""docstring for handleWrite"""
		sys.stdout.write("Write: ")
		writeLine = sys.stdin.readline()
		self.board.writeLine(writeLine)

	def handleAbort(self):
		"""docstring for handleAbort"""
		return True

	def promptLoop(self):
		"""docstring for promptLoop"""
		abort = False

		while abort == False:
			self.getOpts()
			opt = sys.stdin.readline().rstrip()
			if self.opIsValid(opt) is True:
				abort = self.handleOp(opt)
			else:
				sys.stderr.write("Error: Option is invalid\n")

if __name__ == '__main__':
	arduino = ArduinoShell("/dev/tty.usbserial-A80081qe")
	arduino.promptLoop()