Arduino Code for Bluetooth modules
virs_3I am trying to do use two bluetooth modules to control an LEDs. I am using HC05 as master and another as slave. I can get the two bluetooth module to pair up and communicate with one another using a serial communication in the Arduino IDE. Now what I want to do is to use a push pins to turn on and off an LEDs. Here is my set up for the loop and void set up. I attached also the code that I am using for the bluetooth.
=============================================================
void loop()
{
if(digitalRead(left_arrow_pin) == HIGH)
{
// seems like left arrow button was pressed
// so we clear all the pixels first
clear_all_pixels();
// and then we show the left arrow
left_arrow();
}
else if(digitalRead(right_arrow_pin) == HIGH)
{
// seems like right arrow button was pressed
// so we clear all the pixels first
clear_all_pixels();
// and then we show the right arrow
right_arrow();
}
else if(digitalRead(stop_sign_pin) == HIGH)
{
// seems like stop sign button was pressed
// so we clear all the pixels first
clear_all_pixels();
// and then we show the stop sign
stop_sign();
}
}
====================================================================
void setup()
{
//setting the button pins we defined above as inputs
pinMode(left_arrow_pin, INPUT);
pinMode(right_arrow_pin, INPUT);
pinMode(stop_sign_pin, INPUT);
//initializing the led strip
strip.begin();
strip.show();
}
- 9 years ago
- 20
Purchase the answer to view it
- arduino_master_slave_hc_05.zip
- 1 page essay MLA format
- The Rookie Chief Information Security Officer
- Biological Anthropology homework
- FIN 540/FIN540 MIDTERM (100% SOLUTIONS)
- Researc paper
- A-plus Writer - Discussion—ABC Analysis
- for kim woods
- Looking for a very good Engineering tutor for Engineering Dynamics
- english help
- BUS 322 Assignment 1 Organizational Environment