int angleServo1,angleServo2 = 0;
const int axisX=A0; // ось Х подключена к A0
const int axisY=A1; // ось Y подключена к A1
int valX, valY = 0; // переменные для хранения значений осей
int datos[3];
#include <SPI.h>
void setup()
{
Serial.begin(9600);
}
void loop()
{
valX = analogRead(axisX); // значение оси Х
valY = analogRead(axisY); // значение оси Y
// масштабируем значение к интервалу 0-180
angleServo1=map(valX,0,800,100,-100);
angleServo2=map(valY,0,810,100,-100);
datos[0] = angleServo1;
datos[1] = angleServo2;
Serial.write(datos, sizeof(datos));
delay(100);
}
error: no matching function for call to 'HardwareSerial::write(int [3], unsigned int)'
how to remove an error and pass an array of bytes?
HardwareSerial::write()
does not have a function that will accept two arguments where the first one is an array of integers and the second one is an unsigned integer ..... i think that HardwareSerial::write() only has a function that accepts one argument that is an integer, not an arraywrite(byte)
andwrite(buff[], size)