Electrical control means for the dispensing mechanism