new to arduino

i have the arduino uno , and i have put together a project using rfid. so far i successfully put together the rfid, 2 led’s, a buzzer, a relay using a solenoid lock. and i also have an oled display. now all of this works except for the oled. i have tried adding and taking away. i tried using different codes and i tried to adjust a few. so far i cannot get the oled to display the values of wat the rfid is doing. meaning locked, unlocked, new scan for picc etc… im pretty impressed that i even got this far. so i guess i need help with adding the oled display to my circuit. i also have lcd displays if i needed to go from oled to lcd. im pretty much wanting to get the first one working is the one im using. i am very confident that the issue is me . wat i mean is im not adding the rite code the rite way. i have the circuit put into a small casing if u will, so i can put it into my new ground station case for uav or fpv’s. pls someone rescue a retired vet. pls. thank u in advance to all who come across this. u can also send ur thoughts to

also im new to all this, i think i read the rules correctly, but if i accidentally bump or cross or make a mistake, pls correct me so i am aware. ty my aruduino family. ozzie

Was there a question?

(Is there something wrong with your shift key?)

i wanted to know how to add an oled display to the current mfrc522 code for rfid that im using now. so the question is can anyone help me with showing me how to add an oled to my rfid code?
how do i make an addition to the code without pulling up errors and all that kind of thing. cuz so far i have ton of errors? i dont fully understand the codes and signs. but im getting there slowly. again can anyone help teach me how to add an oled display to my rfid code? and i really am not worried bout the shift key and perfect sentences. if it bothers u that much than pls kindly dont respond to my asking for help. there is others out there. lets not go there again pls. im humbly looking for help. its there in english and everyone can read it. so yeah the shift key. not worried bout it. just need help adding the oled. thanx again everyone.

I think there may be some useful context in your previous thread:

You said you were able to successfully print things to the OLED but not the values read from the RTC. The fact that you were able to print to the OLED is important information because it tells us that the wiring is correct and the OLED works. Is this correct?

The right way to do a project like this is to write an individual test sketch for each component, verify that it works correctly, and make sure that you understand what every line of code does before moving on to the next component. You can often use the example sketches that come with the libraries for this purpose or you can write your own. Save each test sketch in case you need to do troubleshooting later.

Once you have each component of the project working individually you begin to combine them one at a time, testing at each step and only moving to the next component once the previous ones are working together correctly.

So for the OLED and RFID components you should follow these steps:

  • Write a sketch that prints “Hello World” to the OLED.
  • Write a sketch that prints the data from the RFID reader to the Serial Monitor.
  • Write a sketch that prints the data from the RFID reader to the OLED.
  • Incorporate the OLED and RFID reader in to the other components of your project, one at a time.

If you run into a problem at one of those steps then you need to come back here and give a thorough explanation and post the code you’re having trouble with. Take a little time to use proper capitalization, spelling, and punctuation. It might seem uptight but it makes it easier for us to read and it seems disrespectful that you want us to spend our time helping you when you won’t even make a little extra effort with your posts. You need to be very precise in programming, the compiler isn’t going to see you write “u” and say “that’s cool I knew you meant you”. It’s best to take the same approach when asking for help here.

If possible you should always post code directly in the forum thread as text USING CODE TAGS (</> button on the toolbar). This will make it easy for anyone to look at it, which will increase the likelihood of you getting help. If the sketch is longer than the forum will allow then it’s ok to add it as an attachment.

Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read.

When your code requires a library that’s not included with the Arduino IDE please always post a link(using the chain link icon on the toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger(Sketch > Include Library > Manage Libraries) then say so and state the full name of the library.

When you encounter an error you’ll see a button on the right side of the orange bar “Copy error messages”. Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

so the question is can anyone help me with showing me how to add an oled to my rfid code?

First install the library for the OLED you are using, and then use one of the examples in the library to prove the display is working. Once that is done you can worry about integrating it into your application.

its there in english and everyone can read it. so yeah the shift key. not worried bout it. just need help adding the oled.

If your posts are difficult to read most people will just ignore them.

Thank You all very much. Im a 20 Year Army Vet and yes my head can be very hard at times. But now that i read your comments, I see why using the correct punctuation and lettering is so important.
My apologies to my Arduino famiy. Im sorry for being an Ass. I really appreciate you all.
Okay so i will try those idaes thru out the next couple weeks and i will get back to you all as soon as i get the results. Again thank you all so much. And again im sorry for being uptight.

Sincerely. A hard headed old man, lol, ozzie

To all my Arduino brothers. Heres a sooner than later expected update.

I have taken the advice that was given to me . The advice was priceless.

Ok so i have the Uno R3, the mfrc522 rfid module with the card and dongle, a simple bread board, jumper wires, a 9v battery power source and lastly the infamous OLED.

I hooked up the Uno R3 to the RFID card reader and did a successful test run. Then i hooked up the OLED to the unit and also did a seperate test run and as it was a success as well. At this point i attached the solenoid magnetic lock and added it to the rfid code and the lock worked very well with a tweek here and there to the rfid coding. Now all components are hooked up to eachother, but the oled and rfid are working on separate codes.

In order to get the Oled and RFID working on the same library code, i bascically had to write my own sketch from scratch as it was advised on the reply you see above. So i took the RFID sktech i wrote from scratch and the oled sketch i wrote from scratch as well. I then integrated them into one sketch but as you can guess, i had to write and re-write. Then i had to tweek here and fix there. Now i cant explain how i did it all, because this code was my successful accident. All i did was take the advise given to me on this post an to my surprise it all works great.

The only problem i am having is getting the oled to go back to the original screen. For example, I power on the rfid unit. Now i take the dongle and pass it over the rfid reader. The oled the says access granted. But then its stays on that screen. Or if i pass the dongle with the wrong chip in it, it says , access denied and it stays there. in order to get the oled screen to go back to the welcome or original screen i hit the reset button every time.

In short here it is again. I power on the unit. The oled displays the hello or welcome screen setting . Now i pass the dongle over the rfid reader and the oled goes from the welcome/hello screen, to the access granted screen as it is suppose to do. But for some reason it stays there stuck, i cant get it to return to the welcome / hello screen as i want it to.

I dont know if that makes sense but thats the best explanation i can give.

All this again is my successful accident. By taking the advise given on here i was able to make this project a success. I tested the oled and rfid. I then wrote my own codes and tested them repeatedly. Then i painfully integrated them into one code and it was a success.

So my arduino family. I need you once again. I need to get the oled screen to loop or recycle itself to the original screen after it is done displaying a command. I humbly beg your help gentlemen.

I shall await your response , ozzie (iceman69004).

Don't know which display you have, but every display has a "clear" function.
You can add that to the sketch just before you print something new.

Have a look at this PDF.

Page 15.

void fillScreen(uint16_t BLACK);

Wait for someone to correct me if it doesn't work.

It might be a good idea to post your code; use code tags (see the sticky 'how to use the forum' as to how to post code).

Your post may not exceed 9000 characters, so you might have to attach the code to a post or split the code over two separate posts. In the latter case, use a logical separation, e.g. setup() and all things before that in the first post and e.g. loop() in the second post.

Thanks to all who have helped and to those who truly contributed. I was able to get the last part on my own. Again, an accidental success. The screen now returns to its welcome page after it is done with the command given. I will post code here shortly.

Thanks again to all of you, Iceman69004

Glad to hear you have it working. Good job! Sounds like a cool project.

The technique of breaking a project into its individual components and developing it in stages seems at first like it would be slower and more tedious but I've found it usually ends up being faster in the end and less frustrating too. I still sometimes end up getting ahead of myself and writing a code for components that haven't been delivered to me yet because I'm excited for the project but half the time I end up having to back up and go through it again. I'm trying to be more disciplined about that sort of thing now.

This approach is further enhanced when you start using version control because you can make a commit at each stage of development and then easily be able to go back to any point in the version history later if necessary. Learning to use version control software adds extra complexity at first so it's not necessarily recommended for a beginner but getting into the habit of doing development in logical steps is a very good first step in that direction.