--- /home/andrew/Github/AlexaPi/main.py	2017-02-14 13:01:33.083942183 -0800
+++ /home/andrew/Github/AlexaPi2/main.py	2017-02-16 17:02:13.009088622 -0800
@@ -3,20 +3,21 @@
 import os
 import random
 import time
-import RPi.GPIO as GPIO
+import CHIP_IO.GPIO as GPIO
 import alsaaudio
 import wave
 import random
-from creds import *
 import requests
 import json
 import re
+from creds import *
+from alexaToken import *
 from memcache import Client
 
 #Settings
-button = 18 #GPIO Pin with button connected
-lights = [24, 25] # GPIO Pins with LED's conneted
-device = "plughw:1" # Name of your microphone/soundcard in arecord -L
+button = "CSID0" #GPIO Pin with button connected
+lights = ["CSID1", "CSID2"] # GPIO Pins with LED's conneted
+device = "default" # Name of your microphone/soundcard in arecord -L
 
 #Setup
 recorded = False
@@ -24,8 +25,6 @@
 mc = Client(servers, debug=1)
 path = os.path.realpath(__file__).rstrip(os.path.basename(__file__))
 
-
-
 def internet_on():
     print "Checking Internet Connection"
     try:
@@ -110,9 +109,13 @@
 
 def start():
 	last = GPIO.input(button)
+	print("Activity LED's have been set up on " + lights[0] + " and " + lights[1] + ".")
 	while True:
-		val = GPIO.input(button)
-		GPIO.wait_for_edge(button, GPIO.FALLING) # we wait for the button to be pressed
+		print("Waiting for user to press a button that sets " + button + " to HIGH...")
+		while(GPIO.input(button)==0): # wait until button is pushed
+			time.sleep(0.01)
+
+		print("RECORDING... release button when done...")
 		GPIO.output(lights[1], GPIO.HIGH)
 		inp = alsaaudio.PCM(alsaaudio.PCM_CAPTURE, alsaaudio.PCM_NORMAL, device)
 		inp.setchannels(1)
@@ -120,7 +123,7 @@
 		inp.setformat(alsaaudio.PCM_FORMAT_S16_LE)
 		inp.setperiodsize(500)
 		audio = ""
-		while(GPIO.input(button)==0): # we keep recording while the button is pressed
+		while(GPIO.input(button)==1): # we keep recording while the button is pressed
 			l, data = inp.read()
 			if l:
 				audio += data
@@ -128,6 +131,7 @@
 		rf.write(audio)
 		rf.close()
 		inp = None
+		print("Contacting Alexa...")
 		alexa()
 
 	
@@ -137,8 +141,11 @@
 	GPIO.cleanup()
 	GPIO.setmode(GPIO.BCM)
 	GPIO.setup(button, GPIO.IN, pull_up_down=GPIO.PUD_UP)
-	GPIO.setup(lights, GPIO.OUT)
-	GPIO.output(lights, GPIO.LOW)
+	GPIO.setup(lights[0], GPIO.OUT)
+	GPIO.setup(lights[1], GPIO.OUT)
+	GPIO.output(lights[0], GPIO.LOW)
+	GPIO.output(lights[1], GPIO.LOW)
+
 	while internet_on() == False:
 		print "."
 	token = gettoken()
