Artwork

Treść dostarczona przez Programming Electronics Academy. Cała zawartość podcastów, w tym odcinki, grafika i opisy podcastów, jest przesyłana i udostępniana bezpośrednio przez Programming Electronics Academy lub jego partnera na platformie podcastów. Jeśli uważasz, że ktoś wykorzystuje Twoje dzieło chronione prawem autorskim bez Twojej zgody, możesz postępować zgodnie z procedurą opisaną tutaj https://pl.player.fm/legal.
Player FM - aplikacja do podcastów
Przejdź do trybu offline z Player FM !

Using the Same Input to Trigger Multiple Arduinos

9:41
 
Udostępnij
 

Manage episode 269164111 series 2774299
Treść dostarczona przez Programming Electronics Academy. Cała zawartość podcastów, w tym odcinki, grafika i opisy podcastów, jest przesyłana i udostępniana bezpośrednio przez Programming Electronics Academy lub jego partnera na platformie podcastów. Jeśli uważasz, że ktoś wykorzystuje Twoje dzieło chronione prawem autorskim bez Twojej zgody, możesz postępować zgodnie z procedurą opisaną tutaj https://pl.player.fm/legal.

If you ever have a project using two or more Arduinos, it's likely you'll want them to work together.

Say for example you have one Arduino connected to an LCD shield, and another Arduino controlling an LED matrix. You want both to do something when you press a single button - how can this be done?

It turns out to be extremely easy. This video will describe in detail how to trigger multiple Arduinos with a single input.

CODE:

/* Button Turns on and off a light emitting diode(LED) connected to digital pin 13, when pressing a pushbutton attached to pin 2. The circuit: * LED attached from pin 13 to ground * pushbutton attached to GND through pin 2 on two (or more) Arduino's * Note: on most Arduinos there is already an LED on the board attached to pin 13. created 2005 by DojoDave modified 30 Aug 2011 by Tom Igoe Modified 16 APR 2015 by Michael James https://programmingelectronics.com/using-the-same-input-to-trigger-multiple-arduinos/ This example code is in the public domain. http://www.arduino.cc/en/Tutorial/Button */ // constants won't change. They're used here to // set pin numbers: const int buttonPin = 2; // the number of the pushbutton pin const int ledPin = 13; // the number of the LED pin // variables will change: int buttonState = 0; // variable for reading the pushbutton status void setup() { // initialize the LED pin as an output: pinMode(ledPin, OUTPUT); // initialize the pushbutton pin as an input: pinMode(buttonPin, INPUT_PULLUP); } void loop() { // read the state of the pushbutton value: buttonState = digitalRead(buttonPin); // check if the pushbutton is pressed. // if it is, the buttonState is HIGH: if (buttonState == LOW) { // turn LED on: digitalWrite(ledPin, HIGH); } else { // turn LED off: digitalWrite(ledPin, LOW); } }

Breadboard Layout:

Downloads:

Schematic Fritzing File.fzz

If you like this tutorial, check out some of out very best by signing up for our free Arduino Crash Course below.

  continue reading

61 odcinków

Artwork
iconUdostępnij
 
Manage episode 269164111 series 2774299
Treść dostarczona przez Programming Electronics Academy. Cała zawartość podcastów, w tym odcinki, grafika i opisy podcastów, jest przesyłana i udostępniana bezpośrednio przez Programming Electronics Academy lub jego partnera na platformie podcastów. Jeśli uważasz, że ktoś wykorzystuje Twoje dzieło chronione prawem autorskim bez Twojej zgody, możesz postępować zgodnie z procedurą opisaną tutaj https://pl.player.fm/legal.

If you ever have a project using two or more Arduinos, it's likely you'll want them to work together.

Say for example you have one Arduino connected to an LCD shield, and another Arduino controlling an LED matrix. You want both to do something when you press a single button - how can this be done?

It turns out to be extremely easy. This video will describe in detail how to trigger multiple Arduinos with a single input.

CODE:

/* Button Turns on and off a light emitting diode(LED) connected to digital pin 13, when pressing a pushbutton attached to pin 2. The circuit: * LED attached from pin 13 to ground * pushbutton attached to GND through pin 2 on two (or more) Arduino's * Note: on most Arduinos there is already an LED on the board attached to pin 13. created 2005 by DojoDave modified 30 Aug 2011 by Tom Igoe Modified 16 APR 2015 by Michael James https://programmingelectronics.com/using-the-same-input-to-trigger-multiple-arduinos/ This example code is in the public domain. http://www.arduino.cc/en/Tutorial/Button */ // constants won't change. They're used here to // set pin numbers: const int buttonPin = 2; // the number of the pushbutton pin const int ledPin = 13; // the number of the LED pin // variables will change: int buttonState = 0; // variable for reading the pushbutton status void setup() { // initialize the LED pin as an output: pinMode(ledPin, OUTPUT); // initialize the pushbutton pin as an input: pinMode(buttonPin, INPUT_PULLUP); } void loop() { // read the state of the pushbutton value: buttonState = digitalRead(buttonPin); // check if the pushbutton is pressed. // if it is, the buttonState is HIGH: if (buttonState == LOW) { // turn LED on: digitalWrite(ledPin, HIGH); } else { // turn LED off: digitalWrite(ledPin, LOW); } }

Breadboard Layout:

Downloads:

Schematic Fritzing File.fzz

If you like this tutorial, check out some of out very best by signing up for our free Arduino Crash Course below.

  continue reading

61 odcinków

Wszystkie odcinki

×
 
Loading …

Zapraszamy w Player FM

Odtwarzacz FM skanuje sieć w poszukiwaniu wysokiej jakości podcastów, abyś mógł się nią cieszyć już teraz. To najlepsza aplikacja do podcastów, działająca na Androidzie, iPhonie i Internecie. Zarejestruj się, aby zsynchronizować subskrypcje na różnych urządzeniach.

 

Skrócona instrukcja obsługi

Posłuchaj tego programu podczas zwiedzania
Odtwarzanie