Предупреждаю сразу я нуб в ардуино !Вопрос таков -есть ардуино с кодом , с подключенными к ним кнопками , вот так http://www.instructables.com/id/Tur...acitive-sensor-for/step3/Putting-it-together/ код на ардуине : Код (Text): // Pin for the LED int LEDPin = 13; // Pin to connect to your drawing int capSensePin11 = 11; int capSensePin12 = 12; int capSensePin1 = 1; int capSensePin2 = 2; int capSensePin3 = 3; int capSensePin4 = 4; int capSensePin5 = 5; int capSensePin6 = 6; int capSensePin7 = 7; int capSensePin8 = 8; int capSensePin9 = 9; int capSensePin10 = 10; // This is how high the sensor needs to read in order // to trigger a touch. You'll find this number // by trial and error, or you could take readings at // the start of the program to dynamically calculate this. int touchedCutoff = 60; void setup(){ Serial.begin(9600); // Set up the LED pinMode(LEDPin, OUTPUT); digitalWrite(LEDPin, LOW); } void loop(){ // If the capacitive sensor reads above a certain threshold, // turn on the LED if (readCapacitivePin(capSensePin12) > touchedCutoff) { digitalWrite(LEDPin, HIGH); } else { digitalWrite(LEDPin, LOW); } if (readCapacitivePin(capSensePin1) > touchedCutoff) { digitalWrite(LEDPin, HIGH); } else { digitalWrite(LEDPin, LOW); } if (readCapacitivePin(capSensePin2) > touchedCutoff) { digitalWrite(LEDPin, HIGH); } else { digitalWrite(LEDPin, LOW); } if (readCapacitivePin(capSensePin3) > touchedCutoff) { digitalWrite(LEDPin, HIGH); } else { digitalWrite(LEDPin, LOW); } if (readCapacitivePin(capSensePin4) > touchedCutoff) { digitalWrite(LEDPin, HIGH); } else { digitalWrite(LEDPin, LOW); } if (readCapacitivePin(capSensePin5) > touchedCutoff) { digitalWrite(LEDPin, HIGH); } else { digitalWrite(LEDPin, LOW); } if (readCapacitivePin(capSensePin6) > touchedCutoff) { digitalWrite(LEDPin, HIGH); } else { digitalWrite(LEDPin, LOW); } if (readCapacitivePin(capSensePin7) > touchedCutoff) { digitalWrite(LEDPin, HIGH); } else { digitalWrite(LEDPin, LOW); } if (readCapacitivePin(capSensePin8) > touchedCutoff) { digitalWrite(LEDPin, HIGH); } else { digitalWrite(LEDPin, LOW); } if (readCapacitivePin(capSensePin9) > touchedCutoff) { digitalWrite(LEDPin, HIGH); } else { digitalWrite(LEDPin, LOW); } if (readCapacitivePin(capSensePin10) > touchedCutoff) { digitalWrite(LEDPin, HIGH); } else { digitalWrite(LEDPin, LOW); } if (readCapacitivePin(capSensePin11) > touchedCutoff) { digitalWrite(LEDPin, HIGH); } else { digitalWrite(LEDPin, LOW); } // Every 500 ms, print the value of the capacitive sensor if ( (millis() % 500) == 0){ Serial.print(analogRead(capSensePin1)); Serial.print("1"); } if ( (millis() % 500) == 0){ Serial.print(analogRead(capSensePin2)); Serial.print("2"); }if ( (millis() % 500) == 0){ Serial.print(analogRead(capSensePin3)); Serial.print("3"); }if ( (millis() % 500) == 0){ Serial.print(analogRead(capSensePin4)); Serial.print("4"); }if ( (millis() % 500) == 0){ Serial.print(analogRead(capSensePin5)); Serial.print("5"); }if ( (millis() % 500) == 0){ Serial.print(analogRead(capSensePin6)); Serial.print("6"); }if ( (millis() % 500) == 0){ Serial.print(analogRead(capSensePin7)); Serial.print("7"); }if ( (millis() % 500) == 0){ Serial.print(analogRead(capSensePin8)); Serial.print("8"); }if ( (millis() % 500) == 0){ Serial.print(analogRead(capSensePin9)); Serial.print("9"); }if ( (millis() % 500) == 0){ Serial.print(analogRead(capSensePin10)); Serial.print("10"); }if ( (millis() % 500) == 0){ Serial.print(analogRead(capSensePin11)); Serial.print("11"); }if ( (millis() % 500) == 0){ Serial.print(analogRead(capSensePin12)); Serial.print("12"); } } // readCapacitivePin // Input: Arduino pin number // Output: A number, from 0 to 17 expressing // how much capacitance is on the pin // When you touch the pin, or whatever you have // attached to it, the number will get higher // In order for this to work now, // The pin should have a 1+Megaohm resistor pulling // it up to +5v. uint8_t readCapacitivePin(int pinToMeasure){ // This is how you declare a variable which // will hold the PORT, PIN, and DDR registers // on an AVR volatile uint8_t* port; volatile uint8_t* ddr; volatile uint8_t* pin; // Here we translate the input pin number from // Arduino pin number to the AVR PORT, PIN, DDR, // and which bit of those registers we care about. byte bitmask; if ((pinToMeasure >= 0) && (pinToMeasure <= 7)){ port = &PORTD; ddr = &DDRD; bitmask = 1 << pinToMeasure; pin = &PIND; } if ((pinToMeasure > 7) && (pinToMeasure <= 13)){ port = &PORTB; ddr = &DDRB; bitmask = 1 << (pinToMeasure - 8); pin = &PINB; } if ((pinToMeasure > 13) && (pinToMeasure <= 19)){ port = &PORTC; ddr = &DDRC; bitmask = 1 << (pinToMeasure - 13); pin = &PINC; } // Discharge the pin first by setting it low and output *port &= ~(bitmask); *ddr |= bitmask; delay(1); // Make the pin an input WITHOUT the internal pull-up on *ddr &= ~(bitmask); // Now see how long the pin to get pulled up int cycles = 16000; for(int i = 0; i < cycles; i++){ if (*pin & bitmask){ cycles = i; break; } } // Discharge the pin again by setting it low and output // It's important to leave the pins low if you want to // be able to touch more than 1 sensor at a time - if // the sensor is left pulled high, when you touch // two sensors, your body will transfer the charge between // sensors. *port &= ~(bitmask); *ddr |= bitmask; return cycles; } Мне нужно сделать связь между ардуино и программой на VStudio C# 2012 , а точнее чтобы при контакте с тачем (кнопкой) отправлялась команда в программу и имитировалась нажатие кнопки. Прошить ардуино я не могу так-как у меня китай((( жду предложений.