In 2010, you purchased a used machine for $10,000 that you used solely for business purposes. You sold it 2 1/2 years later for $7,000. During the time you owned it, you claimed $6,160 in depreciation on the machine. Your basis in the property at the time of the sale was $3,840 ($10,000 - $6,160 = $3,840).
Your gain taxed as ordinary income is the lower of your depreciation deductions claimed ($6,160) or your amount realized from the sale minus your tax basis ($7,000 - $3,840 = $3,160). So, in this case all of your gains would be taxed as ordinary income.
If by some miracle, the machine had been sold for $12,000, the total gain would have been $8,160 ($12,000 - $3,840 = $8,160). Of this gain, $6,160 would have been taxed as ordinary income and $2,000 would have been taxed as long-term capital gain.