You can't aim the cannons, they are stationary. You'll just have to wait until it is lined up.
For the ballista, first you must gather the ballista ammo. To use it, highlight the ammo in your item selection, step up to the ballista, and press the item button. Use the left analogue stick to aim the ballista, and the "confirm" button to fire.