Working out correct calculations for resistance from different data sheets

I just want to point out that 40 mA is the absolute maximum rating of the pin. I would be calculating on a 20 mA output.