I am writing a program and need a map in it. Here is the code:
#include "pitches.h"
int button_1 = 2;
int button_2 = 3;
int button_3 = 4;
int button_4 = 5;
int button_5 = 6;
int button_6 = 7;
int button_7 = 8;
int Button1_high = 0;
int Button2_high = 0;
int Button3_high = 0;
int Button4_high = 0;
int Button5_high = 0;
int Button6_high = 0;
int Button7_high = 0;
int Pot_pin = A0;
int Pot_value = 0;
int Speaker_pin = 13;
int Notes [][7] {
{NOTE_C1, NOTE_D1, NOTE_E1, NOTE_F1, NOTE_G1, NOTE_A1, NOTE_B1},
{NOTE_C2, NOTE_D2, NOTE_E2, NOTE_F2, NOTE_G2, NOTE_A2, NOTE_B2},
{NOTE_C3, NOTE_D3, NOTE_E3, NOTE_F3, NOTE_G3, NOTE_A3, NOTE_B3},
{NOTE_C4, NOTE_D4, NOTE_E4, NOTE_F4, NOTE_G4, NOTE_A4, NOTE_B4},
{NOTE_C5, NOTE_D5, NOTE_E5, NOTE_F5, NOTE_G5, NOTE_A5, NOTE_B5},
{NOTE_C6, NOTE_D6, NOTE_E6, NOTE_F6, NOTE_G6, NOTE_A6, NOTE_B6},
{NOTE_C7, NOTE_D7, NOTE_E7, NOTE_F7, NOTE_G7, NOTE_A7, NOTE_B7},
}
;
void setup() {
//Setup Pot as Input
pinMode (Pot_pin, INPUT);
//Setup Speaker as Output
pinMode (Speaker_pin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
Pot_value = analogRead(Pot_pin);
Pot_config = map(Pot_value, 0, 1023, 0, 6);
if (Pot_value = 0) {
Button1_high = digitalRead(button_1);
Button2_high = digitalRead(button_2);
Button3_high = digitalRead(button_3);
Button4_high = digitalRead(button_4);
Button5_high = digitalRead(button_5);
Button6_high = digitalRead(button_6);
Button7_high = digitalRead(button_7);
if (Button1_high = 1) {
//Play the tone
}
if (Button2_high = 1) {
//Play the tone
}
if (Button3_high = 1) {
//Play the tone
}
if (Button4_high = 1) {
//Play the tone
}
}
}
I am getting an error that the map isn't declared. I have looked everywhere and I can't see anything about declaring a map. Why is it do this?