Author Topic: Arduino Plugin  (Read 22154 times)

0 Members and 1 Guest are viewing this topic.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Arduino Plugin
« Reply #45 on: December 24, 2015, 12:28:14 PM »
This sounds good and I'm sure you will understand fast how things work in VC.
« Last Edit: December 24, 2015, 12:30:48 PM by Kalle »
***********  get excited and make things  **********

mexicanto

  • Contributor
  • ***
  • Posts: 55
  • Karma: 1
    • View Profile
Re: Arduino Plugin
« Reply #46 on: December 24, 2015, 12:36:10 PM »
Hi again Kalle,

Can you check your inbox ? i already sent you a pm

My main goal is to have the most plug-n-play system, because after what i did with
the harmony remote, and what i am going to do with mysensor, my friends are going
to ask me to install something like mine in their homes, and my rule is:
"the easiest and simplest, the better"

thank you for your support, kalle and james

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Arduino Plugin
« Reply #47 on: December 24, 2015, 12:49:09 PM »
The last PM I got is your mail address.
« Last Edit: December 24, 2015, 01:05:30 PM by Kalle »
***********  get excited and make things  **********

mexicanto

  • Contributor
  • ***
  • Posts: 55
  • Karma: 1
    • View Profile
Re: Arduino Plugin
« Reply #48 on: December 24, 2015, 01:06:54 PM »
Yes Kalle, thats my last pm,

I will keep in touch with you

This question is probably out of this forum, but just for my information:
what is the difference between a event with number 9 and event with number 3 ?

thank you

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Arduino Plugin
« Reply #49 on: December 24, 2015, 01:13:32 PM »
If you are talking about the event icon the number is meaningless so there is no difference. It's just a picture.

mexicanto

  • Contributor
  • ***
  • Posts: 55
  • Karma: 1
    • View Profile
Re: Arduino Plugin
« Reply #50 on: December 24, 2015, 01:28:06 PM »
Thank you, yes, i was talking about the event icon

mexicanto

  • Contributor
  • ***
  • Posts: 55
  • Karma: 1
    • View Profile
Re: Arduino Plugin
« Reply #51 on: December 29, 2015, 09:52:56 AM »
I know this codes/sketches/scripts are in other post
I just want to put everything in one post for whom ever can use it

thanks to james and laksmanx, the authors of the code

The notes:
I tested it with 2 leds, 2 potentiometers, and 2 pushbuttons
I suggest that you use a pulldown resistors on the analog inputs not in use
to avoid floating readings, this same applies to the pushbuttons in use


in my test i connect the leds to pins 6 & 7
the potentiometers on pins A1 & A3 (i will use the potentiometer on pin3 for later use, a smoke/fire alarm)
the pushbuttons on pins 11 & 12

happy holidays

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.7-->
<commandGroup open="True" name="LED-Pin-Hello-WR" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="310" name="Arduino Startup" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>PY.ExecFile</cmdType>
      <params>
        <param>PY\ArduinoStartup.py</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>VC.Loaded</event>
  </command>
  <command id="798" name="Set The LED On" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Set The LED On</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Set The LED On</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>PY.ExecString</cmdType>
      <params>
        <param>arduinoWrite("dw.high.6")</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Set The LED On</phrase>
  </command>
  <command id="817" name="Set The LED Off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Set The LED Off</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Set The LED Off</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>PY.ExecString</cmdType>
      <params>
        <param>arduinoWrite("dw.low.6")</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Set The LED Off</phrase>
  </command>
  <command id="779" name="Get The Value" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>PY.ExecString</cmdType>
      <params>
        <param>arduinoWrite("ar.1")</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Get The Value</phrase>
  </command>
  <command id="796" name="Read value of pin {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>PY.ExecString</cmdType>
      <params>
        <param>arduinoWrite("ar.{1}")</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Read value of pin</phrase>
    <payloadRange>0,15</payloadRange>
  </command>
  <command id="756" name="analog value event" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>The Pin number. {1}. has a value of. {2}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>The Pin number. {1}. has a value of. {2}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Analog.Pin</event>
  </command>
  <command id="784" name="Set pin {1} high" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Set Pin. {1}. High</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Set Pin. {1}. High</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>PY.ExecString</cmdType>
      <params>
        <param>arduinoWrite("dw.high.{1}")</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Set pin</phrase>
    <payloadRange>1,50</payloadRange>
    <phrase>high</phrase>
  </command>
  <command id="829" name="Set pin {1} low" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Set Pin. {1}. Low</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Set Pin. {1}. Low</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>PY.ExecString</cmdType>
      <params>
        <param>arduinoWrite("dw.low.{1}")</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Set pin</phrase>
    <payloadRange>1,50</payloadRange>
    <phrase>low</phrase>
  </command>
  <command id="736" name="hello arduino" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>PY.ExecString</cmdType>
      <params>
        <param>arduinoWrite("hello")</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>hello arduino</phrase>
  </command>
  <command id="746" name="Button One Is Pressed" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Button One Is Pressed</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Button One Is Pressed</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>ButtonOne.Pressed
</event>
  </command>
  <command id="398" name="Button One Is Released" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Button One Is Released</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Button One Is Released</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>ButtonOne.State.Released
</event>
  </command>
  <command id="399" name="Button Two Is Pressed" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Button Two Is Pressed</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Button Two Is Pressed</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>SMTP.Send</cmdType>
      <params>
        <param>7148308504@mymetropcs.com</param>
        <param>Button 2 Pressed</param>
        <param>The Button No. 2 Has Been Pressed</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>SMS Pressed Sent</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>SMS Pressed Sent</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>ButtonTwo.Pressed
</event>
  </command>
  <command id="400" name="Button Two Is Released" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Button Two Is Released</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Button Two Is Released</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>SMTP.Send</cmdType>
      <params>
        <param>7148308504@mymetropcs.com</param>
        <param>Button 2 Release</param>
        <param>The Button N. 2 Has Been Release</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>SMS Released Sent</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>SMS Released Sent</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>ButtonTwo.Released
</event>
  </command>
</commandGroup>
« Last Edit: December 29, 2015, 09:55:32 AM by mexicanto »