Guest User

Untitled

a guest
Feb 15th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.29 KB | None | 0 0
  1. ## Copyright (c) 2009 Benjamin Eckel        
  2. ##
  3. ## This is free software; you can redistribute it and/or modify
  4. ## it under the terms of the GNU General Public License as published by
  5. ## the Free Software Foundation; either version 2 of the License, or
  6. ## (at your option) any later version.
  7. ##
  8. ## This is distributed in the hope that it will be useful,
  9. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. ## GNU General Public License for more details.
  12. ##
  13. ## You should have received a copy of the GNU General Public License
  14. ## with this; if not, write to the Free Software
  15. ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  16. #
  17. # module for configuration and commands
  18. #
  19. from Arduinos import Arduino
  20.  
  21.  
  22. # Program Settings
  23. DEBUG = True
  24.  
  25. # IRC Settings
  26. NICK = "arduino"
  27. SERVER = "irc.freenode.net"
  28. CHANNEL = "#test"
  29. PORT = 6667
  30.  
  31. # Arduino Settings
  32. PORT = '\\.\COM3'
  33. BAUD = 9600
  34.  
  35. # define methods
  36. def lightLed(arduino, args):
  37.     arduino.send('~') # header
  38.     arduino.send(args[0])
  39.     arduino.send('~') # terminating
  40.     return arduino.read(4) # read 4 bytes from arduino
  41.    
  42. def readPot(arduino):  
  43.    
  44.     arduino.send('}}') # header
  45.    
  46.     return arduino.read(4) # read 4 bytes from arduino
Advertisement
Add Comment
Please, Sign In to add comment