Group Assignment
Measure the power consumption of an output device.
Document your work on the group work page and reflect on your individual page what you learned.
For this week’s group assignment, we measured the power consumption of an output device.
Through Our group documentation includes full details on our shared experimentation with multiple output devices.
by this Week 10 of the Fab Academy, I continued by output devices that make a given display or output from comands. I was targeting to work on driving stepper motor
The stepper motor has five pins: IN1, IN2, IN3, IN4, VCC, (DIGITAL output). I connected them to the Xiao board as follows:
After wiring, I wrote codes to control the motor. Below is the code I uploaded using Arduino IDE to drive the stepper motor:
#include
int in1 = D1 ;
int in2 = D2 ;
int in3 = D3 ;
int in4 = D4 ;
Stepper s(2048, in1, in3, in2, in4);
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
s.setSpeed(10);
s.step(2048);
delay(1000);
s.setSpeed(10);
s.step(-2048);
delay(1000);
}
when I uploaded the codes to my xiao microcontroller, stepperwas moving forward and backwrad 360 degrees as commanded from the codes above
This week helped me understand how to deal with output devices comanded from microcontrollers and also how to connect diferent output devices on microcontroller. codes that controlls stepper motor in both directions
You can download the Arduino code used for this experiment below:
codes to drive stepper motor