- Tue Jan 30, 2018 2:17 pm
#198101
Hi there,
I'm learning how to work with Arduino and have started a project of creating a little robot that will adjust my rooms dimmer switch via remote. I have a set up using a 28BYJ stepper motor and an Arduino Uno. I will have a lead screw running vertically powered by the stepper motor that will spin, raising a nut on the screw that will be attached to the dimmer switch adjusting it on and off. So far I have all of the coding for moving the motor with the IR remote but I would like to spruce it up some. I am looking to have it where I can jog the lights by pressing the remotes left and right arrows, turn all the way on and all the way off by hitting the up and down arrows and move to a certain position based off of the number button I hit, for example, moving to half brightness if I hit button 5. I understand stepper motors move a certain amount of steps based off of the commands it is given and I have been able to assign each button a different distance to travel but how can I achieve the ability to say move to 50% brightness from 75% brightness? Right now I can only make the motor move a certain distance in one way or another based strictly off the commands in the code. I am looking for how to tell it to move to a certain position based off of what button is pressed regardless of its initial position. Any help is greatly appreciated.
I'm learning how to work with Arduino and have started a project of creating a little robot that will adjust my rooms dimmer switch via remote. I have a set up using a 28BYJ stepper motor and an Arduino Uno. I will have a lead screw running vertically powered by the stepper motor that will spin, raising a nut on the screw that will be attached to the dimmer switch adjusting it on and off. So far I have all of the coding for moving the motor with the IR remote but I would like to spruce it up some. I am looking to have it where I can jog the lights by pressing the remotes left and right arrows, turn all the way on and all the way off by hitting the up and down arrows and move to a certain position based off of the number button I hit, for example, moving to half brightness if I hit button 5. I understand stepper motors move a certain amount of steps based off of the commands it is given and I have been able to assign each button a different distance to travel but how can I achieve the ability to say move to 50% brightness from 75% brightness? Right now I can only make the motor move a certain distance in one way or another based strictly off the commands in the code. I am looking for how to tell it to move to a certain position based off of what button is pressed regardless of its initial position. Any help is greatly appreciated.