EasyManua.ls Logo

Seeed Grove Beginner Kit - Page 27

Seeed Grove Beginner Kit
71 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Software Code
Open Arduino IDE.
Copy the following code, click Verify to check for syntax errors. Verify that there are no
errors, and you can upload the code.
int BuzzerPin = 5;
int Potentiometer = A0;
void setup() {
pinMode(BuzzerPin, OUTPUT);
}
void loop() {
int potentioValue, Value;
potentioValue = analogRead(Potentiometer);
Value = map(potentioValue, 0, 1023, 0, 255); //Mapping potentiometer va
lue to PWM signal value
analogWrite(BuzzerPin, Value);
}
26
Grove Beginner Kit For Arduino®

Other manuals for Seeed Grove Beginner Kit

Related product manuals