Your question is more complicated than most people realize, but esshup has posted an excellent resource.

Further, those codes are for wood that is utilized in protected spaces. The strength of your crossbeams will always be subject to continual reduction due to weathering, insect damage, rot, etc.

It would probably be better to build a little above code and use pressure treated wood.

I also agree with esshup that you need a good plan for your support posts.