Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Copyright (c) 2009 Benjamin Eckel
- ##
- ## This is free software; you can redistribute it and/or modify
- ## it under the terms of the GNU General Public License as published by
- ## the Free Software Foundation; either version 2 of the License, or
- ## (at your option) any later version.
- ##
- ## This is distributed in the hope that it will be useful,
- ## but WITHOUT ANY WARRANTY; without even the implied warranty of
- ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ## GNU General Public License for more details.
- ##
- ## You should have received a copy of the GNU General Public License
- ## with this; if not, write to the Free Software
- ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- #
- # module for configuration and commands
- #
- from Arduinos import Arduino
- # Program Settings
- DEBUG = True
- # IRC Settings
- NICK = "arduino"
- SERVER = "irc.freenode.net"
- CHANNEL = "#test"
- PORT = 6667
- # Arduino Settings
- PORT = '\\.\COM3'
- BAUD = 9600
- # define methods
- def lightLed(arduino, args):
- arduino.send('~') # header
- arduino.send(args[0])
- arduino.send('~') # terminating
- return arduino.read(4) # read 4 bytes from arduino
- def readPot(arduino):
- arduino.send('}}') # header
- return arduino.read(4) # read 4 bytes from arduino
Advertisement
Add Comment
Please, Sign In to add comment