Tuning your guitar with a Piano or Keyboard is a simple task. It is pretty easy and good for beginners because your only playing open strings on the guitar, so you can have a free hand to turn the pegs while the piano and the guitar are resonating. And you also tune each individual string, instead of getting one reference string and tuning the rest of the strings to it.
Open Strings - Down below I will talk about playing Open Strings. To play an Open String means to play a string without fretting anything. So that's why it's called Open.
tuning a guitar using a Piano
The picture above shows you each string on the guitar, it's same note on the Piano or Keyboard. Just Follow the picture for each individual string and tune the string utill it matches the Keyboard or Piano. Make sure you use the 'Middle C' on the picture as a reference point so you dont tune your guitar an octave too low, or too high.
Congratulations on tuning your guitar!