I am trying to connect a motor with MCU (stm32) and I need to write the code (C program in C). As of my understanding, I need to initialize the motor ID (if I have 2 or more motors, each motor should have the unique id so that when i write program I can use controls to the specific motor)..
I have referred few examples to initialize the motors in c programming... one of the example is below...
const uint16_t Motor_id1 = 0x600 + 0x01; const uint16_t motor_id2 = 0x600 + 0x02;
here the two above lines for corresponding motor, which means 2 motor has connected
motor1 can be identified by this value 0x600 + 0x01 motor2 can be identified by this value 0x600 + 0x02
I particularly want to know how this values are assigned for each motors... suppose if i want to connect 3rd and 4th motors can I write
const uint16_t Motor_id1 = 0x600 + 0x03; //for 3rd motors const uint16_t motor_id2 = 0x600 + 0x04; //for 4th motors
is it possible ??? will it work ??
I beleive, if some one can give some basic idea to initialize the motor and how the values are written in c program will be better for me to understand. Please give your suggestion and comments.. those who have experienced in controlling motors using c program through mcu board, they must know these concept. Please help...
The processor or the motor doesn't have any concept of "ID".
So what works or not is just a question of what you invent. So the focus is all on you - what are you able to invent? Your teachers are waiting now, so don't make them disappointed.