Author Topic: Arduino udp or serial monitor trigger event???  (Read 5654 times)

0 Members and 1 Guest are viewing this topic.

Bahraini.75

  • Jr. Member
  • **
  • Posts: 33
  • Karma: 3
    • View Profile
Re: Arduino udp or serial monitor trigger event???
« Reply #15 on: March 09, 2020, 11:32:07 AM »
Hi James
I don't have python code  ::)
I just send arduino code to help me with it
I don't know how to make it work  ::saddest

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Arduino udp or serial monitor trigger event???
« Reply #16 on: March 09, 2020, 11:38:28 AM »
You can't get VoxCommando to communicate with Arduino if you don't use any Python code.  OK, maybe there is a way to do this, but the example that we gave you requires Python code.

Several times we have sent you sample code, which includes both Arduino code and Python code.  The example shows you exactly how to do what you are asking for.  There is no point in continuing to ask us to help you if you ignore the information we give you.

Here is the link you need again: https://voxcommando.com/forum/index.php?topic=1452.msg12742#msg12742

You should review the information here: https://voxcommando.com/mediawiki/index.php?title=Arduino

You might also need to look at this: https://voxcommando.com/mediawiki/index.php?title=Python

One more problem you will need to face.  I do not think you know how to program Arduino.  For example, you are setting your digital pins to HIGH before setting them to OUTPUT.  You need to set them to output first, then you can set them to HIGH.
« Last Edit: March 09, 2020, 11:46:09 AM by nime5ter »

Bahraini.75

  • Jr. Member
  • **
  • Posts: 33
  • Karma: 3
    • View Profile
Re: Arduino udp or serial monitor trigger event???
« Reply #17 on: March 09, 2020, 11:43:32 AM »
Also you attached your arduino code two times but did not attach your python code.

i have bad internet i attach it but it show i didnt that way sorry for that

about the VoxLog.txt file i attach it

Bahraini.75

  • Jr. Member
  • **
  • Posts: 33
  • Karma: 3
    • View Profile
Re: Arduino udp or serial monitor trigger event???
« Reply #18 on: March 09, 2020, 11:55:30 AM »
well you are right i setting my digital pins to HIGH before setting them to OUTPUT
because i copy it from the original code
this the original code :
Code: [Select]
int sw1 = 0; int sw11 = 0; int sw21 = 0;
int sw2 = 0; int sw12 = 0; int sw22 = 0;
int sw3 = 0; int sw13 = 0; int sw23 = 0;
int sw4 = 0; int sw14 = 0; int sw24 = 0;
int sw5 = 0; int sw15 = 0; int sw25 = 0;
int sw6 = 0; int sw16 = 0; int sw26 = 0;
int sw7 = 0; int sw17 = 0; int sw27 = 0;
int sw8 = 0; int sw18 = 0; int sw28 = 0;
int sw9 = 0; int sw19 = 0; int sw29 = 0;
int sw10 = 0; int sw20 = 0; int sw30 = 0;
int sw31 = 0; int sw41 = 0; int sw51 = 0;
int sw32 = 0; int sw42 = 0; int sw52 = 0;
int sw33 = 0; int sw43 = 0; int sw53 = 0;
int sw34 = 0; int sw44 = 0;
int sw35 = 0; int sw45 = 0;
int sw36 = 0; int sw46 = 0;
int sw37 = 0; int sw47 = 0;
int sw38 = 0; int sw48 = 0;
int sw39 = 0; int sw49 = 0;
int sw40 = 0; int sw50 = 0;


void setup() {
 pinMode(22, OUTPUT);     pinMode(32, OUTPUT);     pinMode(42, OUTPUT);     pinMode(52, OUTPUT);
  pinMode(23, OUTPUT);     pinMode(33, OUTPUT);     pinMode(43, OUTPUT);     pinMode(53, OUTPUT);
  pinMode(24, OUTPUT);     pinMode(34, OUTPUT);     pinMode(44, OUTPUT);
  pinMode(25, OUTPUT);     pinMode(35, OUTPUT);     pinMode(45, OUTPUT);
  pinMode(26, OUTPUT);     pinMode(36, OUTPUT);     pinMode(46, OUTPUT);
  pinMode(27, OUTPUT);     pinMode(37, OUTPUT);     pinMode(47, OUTPUT);
  pinMode(28, OUTPUT);     pinMode(38, OUTPUT);     pinMode(48, OUTPUT);
  pinMode(29, OUTPUT);     pinMode(39, OUTPUT);     pinMode(49, OUTPUT);
  pinMode(30, OUTPUT);     pinMode(40, OUTPUT);     pinMode(50, OUTPUT);
  pinMode(31, OUTPUT);     pinMode(41, OUTPUT);     pinMode(51, OUTPUT);
 

  digitalWrite(22, HIGH);    digitalWrite(32, HIGH);    digitalWrite(42, HIGH);    digitalWrite(52, HIGH);
  digitalWrite(23, HIGH);    digitalWrite(33, HIGH);    digitalWrite(43, HIGH);    digitalWrite(53, HIGH);
  digitalWrite(24, HIGH);    digitalWrite(34, HIGH);    digitalWrite(44, HIGH);
  digitalWrite(25, HIGH);    digitalWrite(35, HIGH);    digitalWrite(45, HIGH);
  digitalWrite(26, HIGH);    digitalWrite(36, HIGH);    digitalWrite(46, HIGH);
  digitalWrite(27, HIGH);    digitalWrite(37, HIGH);    digitalWrite(47, HIGH);
  digitalWrite(28, HIGH);    digitalWrite(38, HIGH);    digitalWrite(48, HIGH);
  digitalWrite(29, HIGH);    digitalWrite(39, HIGH);    digitalWrite(49, HIGH);
  digitalWrite(30, HIGH);    digitalWrite(40, HIGH);    digitalWrite(50, HIGH);
  digitalWrite(31, HIGH);    digitalWrite(41, HIGH);    digitalWrite(51, HIGH);

 Serial.begin(9600);
}
void loop() {
  if (Serial.available() > 1) {
    int input = Serial.read() ;

    Serial.println( input, DEC);
 
    if (input == 'A') {
      digitalWrite(22, sw1);
      sw1 = !sw1;
    }
      if (input == 'B'){
        digitalWrite(23, sw2);
      sw2 = !sw2;
  }
            if (input == 'C'){
              digitalWrite(24, sw3);
      sw3 = !sw3;
}
            if (input == 'D'){
              digitalWrite(25, sw4);
      sw4 = !sw4;
}
            if (input == 'E'){
              digitalWrite(26, sw5);
      sw5 = !sw5;
}
            if (input == 'F'){
              digitalWrite(27, sw6);
      sw6 = !sw6;
}
            if (input == 'G'){
              digitalWrite(28, sw7);
      sw7 = !sw7;
}
            if (input == 'H'){
              digitalWrite(29, sw8);
      sw8 = !sw8;
}
            if (input == 'I'){
              digitalWrite(30, sw9);
      sw9 = !sw9;
}
            if (input == 'J'){
              digitalWrite(31, sw10);
      sw10 = !sw10;
}
             if (input == 'K'){
               digitalWrite(32, sw11);
      sw11 = !sw11;
}
             if (input == 'L'){
               digitalWrite(33, sw12);
      sw12 = !sw12;
}
             if (input == 'M'){
               digitalWrite(34, sw13);
      sw13 = !sw13;
}
             if (input == 'N'){
               digitalWrite(35, sw14);
      sw14 = !sw14;
}
             if (input == 'O'){
               digitalWrite(36, sw15);
      sw15 = !sw15;
}
             if (input == 'P'){
               digitalWrite(37, sw16);
      sw16 = !sw16;
}
             if (input == 'Q'){
               digitalWrite(38, sw17);
      sw17 = !sw17;
}
             if (input == 'R'){
               digitalWrite(39, sw18);
      sw18 = !sw18;
}
             if (input == 'S'){
               digitalWrite(40, sw19);
      sw19 = !sw19;
}
             if (input == 'T'){
               digitalWrite(41, sw20);
      sw20 = !sw20;
}
             if (input == 'U'){
               digitalWrite(42, sw21);
      sw21 = !sw21;
}
             if (input == 'V'){
               digitalWrite(43, sw22);
      sw22 = !sw22;
}
             if (input == 'W'){
               digitalWrite(44, sw23);
      sw23 = !sw23;
}
             if (input == 'X'){
               digitalWrite(45, sw24);
      sw24 = !sw24;
}
             if (input == 'Y'){
               digitalWrite(46, sw25);
      sw25 = !sw25;
}
             if (input == 'Z'){
               digitalWrite(47, sw26);
      sw26 = !sw26;
}
             if (input == '1'){
               digitalWrite(48, sw27);
      sw27 = !sw27;
}
             if (input == '2'){
               digitalWrite(49, sw28);
      sw28 = !sw28;
}
             if (input == '3'){
               digitalWrite(50, sw29);
      sw29 = !sw29;
}
             if (input == '4'){
               digitalWrite(51, sw30);
      sw30 = !sw30;
}
             if (input == '5'){
               digitalWrite(52, sw31);
      sw31 = !sw31;
}
             if (input == '6'){
               digitalWrite(53, sw32);
      sw32 = !sw32;
             }
  }
}
« Last Edit: March 09, 2020, 12:04:25 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Arduino udp or serial monitor trigger event???
« Reply #19 on: March 09, 2020, 12:10:09 PM »
The original code is in the correct order.  I guess you made a mistake when you copied it.

In your log it looks like there is an error loading the Python plugin.  Maybe you should start by making a clean install of a newer version of VoxCommando.  This would be the first step.  You need to make sure the Python plugin is working, and then you need to look at the sample code that we provided to you.

Bahraini.75

  • Jr. Member
  • **
  • Posts: 33
  • Karma: 3
    • View Profile
Re: Arduino udp or serial monitor trigger event???
« Reply #20 on: March 09, 2020, 12:15:13 PM »
Ok