Contrôle De Deux LEDs Par Bluetooth (HC-06) - Gist Github
Maybe your like
Skip to content Search Gists Search Gists All gists Back to GitHub Sign in Sign up Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }}
ypelletier/bluetooth_controle_2_LEDs.ino Last active February 16, 2017 17:48 Show Gist options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment You can’t perform that action at this time.
Instantly share code, notes, and snippets.
- Download ZIP
- Star (0) You must be signed in to star a gist
- Fork (0) You must be signed in to fork a gist
- Embed Select an option
- Embed Embed this gist in your website.
- Share Copy sharable link for this gist.
- Clone via HTTPS Clone using the web URL.
No results found
Learn more about clone URLs Clone this repository at <script src="https://gist.github.com/ypelletier/eec815c2ca5c2320a280.js"></script> - Save ypelletier/eec815c2ca5c2320a280 to your computer and use it in GitHub Desktop.
- Embed Embed this gist in your website.
- Share Copy sharable link for this gist.
- Clone via HTTPS Clone using the web URL.
No results found
Learn more about clone URLs Clone this repository at <script src="https://gist.github.com/ypelletier/eec815c2ca5c2320a280.js"></script> Save ypelletier/eec815c2ca5c2320a280 to your computer and use it in GitHub Desktop. Download ZIP Contrôle de deux LEDs par bluetooth (HC-06) Raw bluetooth_controle_2_LEDs.ino This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters| /* Contrôle de deux LEDs par bluetooth |
| Module bluetooth HC-06 |
| LED branchée à la pin 8 |
| LED branché à la pin 9 |
| http://electroniqueamateur.blogspot.ca/2016/03/bluetooth-et-arduino-le-module-hc-06.html |
| */ |
| #define LEDpin1 8 |
| #define LEDpin2 9 |
| char instruction; // le message recu par bluetooth; |
| int etatLED1 = 0, etatLED2 = 0; |
| void setup() |
| { |
| Serial.begin(9600); |
| pinMode(LEDpin1, OUTPUT); |
| pinMode(LEDpin2, OUTPUT); |
| } |
| void loop() |
| { |
| char message; |
| if (Serial.available()) // réception d'un message |
| { |
| message = Serial.read(); // lecture du message reçu |
| } |
| if (message != instruction) { // alors c'est un nouveau message |
| instruction = message; |
| if (instruction == 'a') |
| { |
| digitalWrite(LEDpin1, HIGH); |
| digitalWrite(LEDpin2, LOW); |
| etatLED1 = 1; |
| etatLED2 = 0; |
| Serial.println("LED 1 allumee, LED 2 eteinte"); |
| } |
| else if (instruction == 'b') |
| { |
| digitalWrite(LEDpin1, LOW); |
| digitalWrite(LEDpin2, HIGH); |
| etatLED1 = 0; |
| etatLED2 = 1; |
| Serial.println("LED 1 eteinte, LED 2 allumee"); |
| } |
| else if (instruction == 'c') |
| { |
| digitalWrite(LEDpin1, HIGH); |
| digitalWrite(LEDpin2, HIGH); |
| etatLED1 = 1; |
| etatLED2 = 1; |
| Serial.println("Les 2 LEDs allumees"); |
| } |
| else if (instruction == 'd') |
| { |
| digitalWrite(LEDpin1, LOW); |
| digitalWrite(LEDpin2, LOW); |
| etatLED1 = 0; |
| etatLED2 = 0; |
| Serial.println("Les 2 LEDs eteinte"); |
| } |
| else if (instruction == 'e') |
| { |
| digitalWrite(LEDpin1, !etatLED1); |
| digitalWrite(LEDpin2, !etatLED2); |
| etatLED1 = !etatLED1; |
| etatLED2 = !etatLED2; |
| Serial.println("Les 2 LEDs ont change d'etat"); |
| } |
| delay(500); |
| } |
| } |
Tag » Arduino Hc-06 Led
-
Control LED With Bluetooth! - Arduino Project Hub
-
Arduino Controlling Led With HC-06 Bluetooth Module - Instructables
-
HOW TO CONTROL A LED USING HC-06 BLUETOOTH ... - YouTube
-
How To Control A Led Using HC-06 Bluetooth Module With ... - YouTube
-
Le Module Bluetooth HC-06 | Arduino-passion
-
Persistence Of Vision LED Demo
-
Encender Led Arduino Bluetooth Hc-06 - Arduinoque- Robótica
-
HOW TO CONTROL A LED USING HC-06 ... - Thủ Thuật 24h
-
Arduino And Bluetooth HC-06 To Control The LED With Android Device
-
LED Control Using Arduino Bluetooth And Android. (Part 1) - Pinterest
-
Allumer Et éteindre Une LED Avec Un Smartphone : Le Bluetooth
-
CONTROLA LEDS Con ARDUINO Y BLUETOOTH HC-06 - CODIZI
-
Turning A LED On And Off With An Arduino, A HC-06 And Android
-
Arduino - Bluetooth Device Control On HC-06 - Robo India || Tutorials