1. Design an interface for a ±24 V, 500 mA geared DC motor. The time constant of the motor is 10 ms. Include software to adjust the delivered power from 0 to 100%.
2. An alarm is powered by 120 VAC, and the on/off state of the alarm is controlled by an EM relay. Design the interface between a computer output port and the EM relay. The dropout voltage is 3.5 V, and the coil current needs at least 100 mA. Limit the coil voltage to 6 V. Write three software functions: Alarm_Init, Alarm_On, and Alarm_Off.