I have fixed most of my errors for this code however this one error keeps stumping me:
sketch_mar07a.ino: In function 'void loop()':
sketch_mar07a:12: error: expected primary-expression before ',' token
sketch_mar07a:14: error: expected primary-expression before '[' token
sketch_mar07a:16: error: expected primary-expression before '[' token
sketch_mar07a:18: error: expected primary-expression before '[' token
sketch_mar07a:20: error: expected primary-expression before '[' token
sketch_mar07a:30: error: 'FRAME_LEN' was not declared in this scope
I have read different posts on this but none of them seem to make a whole lot of sense to me as I am a beginner. Am I using readBytesUntil() incorrectly? Or am I missing something else? The code acts as if something is missing in between the comma and byte.
void setup(){
unsigned long ltime;
Serial.begin(38400);
ltime = millis();
}
void loop(){
Serial.read();
int right_V = A1;
Serial.readBytesUntil(byte,[right_V],8);
int right_H = A0;
Serial.readBytesUntil(byte[right_H],8);
int left_V = A2;
Serial.readBytesUntil(byte[left_V],8);
int left_H = A3;
Serial.readBytesUntil(byte[left_H],8);
int Buttons = A4;
Serial.readBytesUntil(byte[Buttons],8);
//Serial.readBytesUntil(byte[extra],8);
// Serial.readBytesUntil(byte[pt],8);
int i=0;
if(i > 10){
digitalWrite(10,HIGH-digitalRead(10));
}
i++;
delay(FRAME_LEN);
pinMode(right_V, OUTPUT); // sets the Analog pin to output
if (right_V != 128){
analogWrite(A1, (right_V + 128));
}
pinMode(right_H, OUTPUT);
if (right_H != 128){
analogWrite(A0, (right_H + 128));
}
pinMode(left_V, OUTPUT);
if (left_V != 128){
analogWrite(A2, (left_V + 128));
}
pinMode(left_H, OUTPUT);
if (left_H != 128){
analogWrite(A3, (left_H + 128));
}
if (Buttons == 64){
analogWrite(A4, 10);
}
pinMode(Buttons, OUTPUT);
if (Buttons == 128){
analogWrite(A4, -10);
}
}