Instructables

Voiceberry Pi!

Featured

Step 6: Updates: A living instructable (11/3/12)

I am so happy that this instructable won me a prize, I've desided to revisit it, and update it with changes I've made.  Two quick changes this morning

  1. I added a sleep statement at the beginning of the loop.  The logic is "If state=waiting, then wait 1 second."  This means I have to hold down the * key to start dialing, but it's a small price to pay to go from 100% CPU utilization to 25% utilization.  Code:

    if (state==waiting):
      time.sleep(1)
     
  2. I added the ability to stop dialing.  Previously, while waiting, you'd press * to start dialing, then if you made a mistake, you'd press * again to start dialing all over again.  I've added some code that checks to see if there is a current number in the buffer.  If there is, it will reset dialing, but if not, it will go back to waiting.  Code:

    ...
    elif (state==dialing):
      if (keyPressed=="*"):
        if (string1==""):
          state=waiting
          showStrings("","Waiting")
        else:
          string1=""
          showStrings("","Dialing")
So that's two things that I was able to "knock off my list" of "what's next" from the last step.  There might be more coming!
 
Remove these adsRemove these ads by Signing Up