Hello!
Is there any way i can send data from arduino to arduino?
My goal is to send Number of steps from the sender to the receiver
the stepper motor is connected to the receiver and i want it to received the numbers of steps it should do from the sender.
the code im working on makes the stepper rotate slowly. Its working as I wanted but the only problem is that its slow… that why im thinking of putting another arduino only for the stepper
this is a part of the code that handles the stepper… RPM_MS (ms) is the wind speed im getting and by that makes the stepper move to a position according to the wind speed
degreeA saves previous steps it made
stepper.startRotate(degreeA[j]); make the stepper rotate according to the number of steps degreeA[j]
```
*void motorpos()
{
move_pos();
unsigned wait_time_micros = stepper.nextAction();
if (wait_time_micros <= 0) {
stepper.disable();
RPM_MS();
}
if (wait_time_micros > 100){
RPM_MS();
}
}
void move_pos()
{
//stepper.rotate(-10000);
//pos=map(ms,0,12,0,18000);
if (ms>12){
ms=12;
}
if ((ms/12)*16500 > 4500 || (ms/12)*16500 <= 0){
pos = (ms/12)*16500;
} else {
pos = 0;
}
if(pos-prevpos != 0){
degreeA[i] = pos-prevpos;
i++;
}
if (degreeA[j]!=0 && stepper.nextAction() == 0 ){
stepper.startRotate(degreeA[j]);
j++;
}
if (j == 19 && stepper.nextAction() == 0){
memset(degreeA, 0, sizeof(degreeA));
//degreeA[0] = (char)0;
j=0;
i=0;
}
prevpos=pos;
}*
```
thank you!