That tutorial sensibly uses atan2 for compass orientation, but for some obscure reason resorts to asin for tilt. The atan2 approach is superior, since you don't need to calibrate the accelerometer/compass nor to scale its output and it will work with the sensor upside down.
float pitchRadians = atan2 (accX, accZ) ;
float rollRadians = atan2 (accY, accZ) ;
When you say that it won't require calibration/scaling does this assume that both the accelerometer & compass are physically level with each other, with their axis all parallel? If I just replace asin in the tutorial with atan2 as you've provided the tilt compensation is completely wrong (applying 150 degrees of compensation to the heading when the compass & accelerometer are flat on the desk).