Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Cuauhtémoc
MICROCONTROLADORES
UNIDAD IV “PROGRAMACION DE
PERIFERICOS DEL MICROCONTROLADOR”
QUE PRESENTA:
CATEDRATICO:
ING. WALTER JESÚS TERÁN MURILLO
Cd. Cuauhtémoc, Chih. A 28 de Abril de 2023
Introducción
void setup() {
pinMode(motorPin1, OUTPUT); Evidencias
pinMode(buttonPin1, INPUT_PULLUP);
pinMode(motorPin2, OUTPUT);
pinMode(buttonPin2, INPUT_PULLUP
} }
void loop() {
// Control del motor 1
if (digitalRead(buttonPin1) == HIGH) {
motorSpeed1 += 10 * motorDirection1;
if (motorSpeed1 >= 255) {
motorDirection1 = -1;
motorDirection1 = 1;
}
}
analogWrite(motorPin1, motorSpeed1);
if (digitalRead(buttonPin2) == HIGH) {
motorSpeed2 += 10 * motorDirection2;
if (motorSpeed2 >= 255) {
motorDirection2 = -1;
} else if (motorSpeed2 <= 0) {
motorDirection2 = 1;
}
}
analogWrite(motorPin2, motorSpeed2);
delay(50);
}
CONCLUSIONES
En esta practica podemos apreciar el funcionamiento de los transistores TIP 120 los
cuales tienen un sistema Darlington el cual es un componente de potencia lo cual nos
permite controlar la velocidad con una señal PWM
EVIDENCIAS