Excel to Arduino

Hei

I just got my first Arduino and need some help.

I would like to make some sort of a warehouse system. So I have a excel file that contains a list of items. Lets say first 100 items are located in one drawer, next 100 items in the second drawer etc. Each drawer is named with letters A,B,C,D etc. and every drawer is separated to 5 sectors. So my 100 items are located in drawer A and separated between 5 sectors.

first 100 items:
20 items - Location A1
20 items - Location A2
20 items - Location A3
20 items - Location A4
20 items - Location A5

next 100 items:
20 items - Location B1
20 items - Location B2
20 items - Location B3
20 items - Location B4
20 items - Location B5

Etc.

Now, if i search an item in excel and find it I would like to send the location of that item to arduino via serial and then arduino would lets say light up an LED in that sector letting me know where that item physically is.

I hope it made sense but if not I will gladly explain further.

I found some topics about how to send information from Excel to Arduino. I tried it today without any luck but will definitely try to get it to work.

I made this for my arduino:

int buttonState = 1;
const int buttonPin = 12;

void setup() {
  Serial.begin(9600);
  pinMode(2, OUTPUT);
  pinMode(12, INPUT);
}

char rx_byte = 0;

void loop() {
 buttonState = digitalRead(12);
 
  
  if (Serial.available() > 0) {
    rx_byte = Serial.read();
  }
  if (rx_byte == 'A') {
    digitalWrite(2, HIGH);
   }  
   else if (buttonState == HIGH) {
    digitalWrite(2, LOW);
  }
}

So If I send letter A in the serial monitor my LED lights up. If i understand correctly the letter A could be sent from excel if set it up correctly? But how do I turn the LED off? I tried to turn it of by pressing on a button but couldn't get it to work. It should turn of when the drawer closes for instance.

Also the rx_byte == 'A' could only accept letters meaning I can't use the sector locations A1,A2,A3, etc.

Like I said I'm very new to this and before I dive in more deeply I would like to get some pointers or ideas how it should be done...

Thanks

It sounds like most of your code is actually going to be written in Visual Basic macros for Excel. Your post suggests that your list of items is going to be too big to fit into the Arduino, so you will need to make a VBA macro that takes the selected item, translates it to a character to send to the Arduino, opens the serial port, and then sends the character. This isn't really the right forum for Excel VBA, but a google search will show you how it's done.

On the Arduino side you'll expand the code that you have now. When you receive a new character, it'd be good to first turn off all of the LEDs, and then turn on the right one specific to which character you received.

How many LEDs do you need? Your post suggests that you might need a lot? The Arduino does not support many without extra hardware.

Why use an LED? Use a LCD to display something like "Aisle A1" or "Rack 2".

Why do you need a button, if you can get the input directly from the Serial Monitor?