What were machetes used for in medieval times?

Machetes weren't used in medival times. They really didn't make an appearance until the early 1700s and derived from a cutlass. Primarily they were (and are) used as an agricultural tool in tropical and subtropical areas; though a form of martial discipline known as 'machete fencing' did make an appearance in Cuba and they were used to a gruesome extent in Ghana and other civil disputes throughout Africa.

The medival weapon you are probably thinking of is a falchion. It was used in the 13th century and was very similar to a machete - being a short sword that widened at the point and had a blunt back edge. The falchion typically had a guard however (as most bladed weapons intended for fighting do) whereas machetes typically do not.