Good morning all,
This is my second post regarding my plan to use an Arduino Uno Mini LE to power LEDS on my 1/8th scale Mustang. Sincere thank to alto777 for solving the first issue I had
The car will be in a display case and I plan to control the LEDs from an App on my phone
I'm using a HC-05 bluetooth module along with an App created on MIT App Inventor 2
The pictures below show that I have the basic set up and running. The Arduino board is powered from the mains (with a switching adaptor plug) I have set the Uno LE up on a small bread board, the pics show the app and the blocks that are set up to power 3 different coloured LEDs
![20220618_104410|375x500](
upload://nRNqkE0fjAwCXIcy3divhRVOdYA.jpeg)
The code I have written is as follows:
char Incoming_value = 0;
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11,OUTPUT);
}
void loop()
{
if(Serial.available() > 0)
{
Incoming_value = Serial.read();
Serial.print(Incoming_value);
Serial.print("\n");
if(Incoming_value == '1')
digitalWrite(13, HIGH);
else if(Incoming_value == '0')
digitalWrite(13, LOW);
if(Incoming_value == '2')
digitalWrite(12, HIGH);
else if(Incoming_value == '3')
digitalWrite(12, LOW);
if(Incoming_value == '4')
digitalWrite(11, HIGH);
else if(Incoming_value == '5')
digitalWrite(11, LOW);
}
}
As a complete noob you may say I have done this incorrectly but its the only way I can get the set up working to control each individual LED
I plan to use the Uno LE to power LEDs for the following purpose:
Leds required:
- Headlights (can be powered from 1 pin) if possible I'd like an option to flash as well as constant
- Spotlights
- Indicator/ side repeaters, these need to be able to flash the front and rear near side, another button for front and near off side. I'd also like an option to have all 4 flash at once like hazard lights
- Rear lamps
- Brake lights
- Interior/ door lights
- Dash lights, there maybe multiple micro led's in different colours (I'll know more when I get to it
I believe the UNO LE has enough pins to power the LEDs I need but this is the problem I have:
To start with I am setting up the front bumper with 2 warm white LEDs (headlights) another 2 warm white LEDs (spotlights) and finally 2 orange LEDs for the indicators/ side repeaters
I have attempted to get the LEDs to blink (as the side repeaters would) but cannot seem to get it to work with the bluetooth. When not connected to bluetooth its simple.
Ideally I'd like the side repeaters to work from individual buttons from the App but then also both together at the same time from another button (simulating a hazard light flashing)
I'd also like the headlights to be able to flash/ blink as well as being on constant
Is this even possible??
Thanks in advance
Pete