Ok, the above code worked out well for me. I got all LEDs to respond. However, now that I am driving some of the analog pins (A1-A4) to the LCD, I am having issues
#include <Wire.h>
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
// these constants won't change:
const int analogPin = A0; // the pin that the potentiometer is attached to
const int ledCount = 10; // the number of LEDs in the bar graph
int ledPin10 = A5;//Denote analog pin A5 as LED output
int ledPins[] = {
10, 9, 8, 7, 6, 5, 4, 3, 2, A5 }; // an array of pin numbers to which LEDs are attached
// delete point
int lcdPina = 18; // LCD connected to digital pin 18-15
int lcdPinb = 17;
int lcdPinc = 16;
int lcdPind = 15;
// delete point
LiquidCrystal lcd(12, 11, 18, 17, 16, 15);
void setup()
{
//delete point
{
pinMode(lcdPina, OUTPUT); // sets the digital pins as outputs
pinMode(lcdPinb, OUTPUT);
pinMode(lcdPinc, OUTPUT);
pinMode(lcdPind, OUTPUT);
}
//delete point
{
lcd.begin(16, 2); // set up the LCD's number of columns and rows:
lcd.print("Ethan's BAC"); // Print a message to the LCD.
}
for (int thisLed = 0; thisLed < ledCount; thisLed++) // loop over the pin array and set them all to output:
{
pinMode(ledPins[thisLed], OUTPUT);
}
}
void loop()
{
//delete point
{
digitalWrite(lcdPina, HIGH); // sets the LED on
digitalWrite(lcdPinb, HIGH);
digitalWrite(lcdPinc, HIGH);
digitalWrite(lcdPind, HIGH);
}
//delete point
int sensorReading = analogRead(analogPin); // read the potentiometer:
int ledLevel = map(sensorReading, 0, 1023, 0, ledCount); // map the result to a range from 0 to the number of LEDs:
for (int thisLed = 0; thisLed < ledCount; thisLed++) // loop over the LED array
{
if (thisLed < ledLevel) //if the array element's index is less than ledLevel, turn the pin for this element on
{
digitalWrite(ledPins[thisLed], HIGH);
}
else //turn off all pins higher than the ledLevel
{
digitalWrite(ledPins[thisLed], LOW);
}
}
}