I'm making a project for one of my classes and have been following a template for it online. It requires an arduino and programming which I have never done before. The code was posted online in the template but I am still getting some errors, any help would be greatly appreciated!
The error is: expected primary-expression before ")" token
and is in the line: set_pixel_brightness(pad_pixel(pad_hit),fader,*color);
And here is the section of the code with said error:
#define PAD_M 0
#define PAD_B 1
#define PAD_L 2
#define PAD_R 3
#define PAD_M_PIX 23
#define PAD_B_PIX 22
#define PAD_L_PIX 20
#define PAD_R_PIX 21
#define HIT_THRESHOLD 75
#define pad_pixel(p) (23-p)
#define COUNT_DOWN_TIME 400
#define SCORE_BLINKS 4
#define ROUNDS 4
#define LEVEL_BAR_PIXELS 20
int *points;
int points_1 = 0;
int points_2 = 0;
long Color_1,Color_2;
long *Color;
long time = 0;
long turn;
int rounds;
void setup() {
strip.begin();
strip.show(); // Initialize all pixels to 'off'
matrix.begin(0x70);
pad_hit = -1;
set_game(MENU_GAME);
}
void loop() {
(*games[current_game].loop_fun)();
}
//------- UTILS -------------
void clear_all() {
matrix.clear();
for(int i=0;i<max_pixels;i++) {
strip.setPixelColor(i, 0);
}
matrix.writeDisplay();
strip.show();
}
int pad_check() {
read_pads();
if (pad_hit >= 0) {
set_pixel_brightness(pad_pixel(pad_hit),fader,*color);
fader--;
if (fader == 0) {
strip.setPixelColor(pad_pixel(pad_hit), fade_to);
strip.show();
pad_hit = -1;
if (fade_func != 0) {
(*fade_func)();
fade_func = 0;
}
}
}
else {
if (pads[PAD_L]> HIT_THRESHOLD && pads[PAD_R] > HIT_THRESHOLD) {
set_game(MENU_GAME);
return 0;
}
for(uint16_t i=0;i<num_pads;i++) {
if (pads > HIT_THRESHOLD ) {
- pad_hit = i;fader = 255;*
- return 1;*
- }*
- }*
- }*
- return 0;*
}