This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
X | Y | |
---|---|---|
3.5 | 5.1 | |
3 | 4.9 | |
3.2 | 4.7 | |
3.1 | 4.6 | |
3.6 | 5 | |
3.9 | 5.4 | |
3.4 | 4.6 | |
3.4 | 5 | |
2.9 | 4.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int soundLevel = 0; | |
int ledPin = 12; | |
bool toggle = false; | |
void toggleLEDState(){ | |
digitalWrite(ledPin, toggle); | |
toggle = !toggle; | |
} | |
void setup() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define NUM_NOTES 8 | |
int buzzerPin = 3; | |
int melody[NUM_NOTES] = { | |
262, 196, 196, 220, 196, 0, 247, 262 | |
}; | |
int noteDurations[NUM_NOTES] = { | |
4, 8, 8, 4, 4, 4, 4, 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> | |
int buttonState = 0; | |
int buttonState_tm1 = 0; | |
const int buttonPin = 0; | |
const int ledPinRed = 6; | |
const int ledPinBlue = 5; | |
const int ledPinGreen = 3; | |
const int servoMotorPin = 9; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> | |
int servoPin = 3; | |
Servo myservo; | |
void setup() { | |
myservo.attach(servoPin); | |
} | |
void loop() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Declare the pins on which the LEDs are connected | |
int ledPinRed = 2; | |
int ledPinYellow = 1; | |
int ledPinGreen = 0; | |
void setup() { | |
// Set the pins 0, 1, 2 as output | |
pinMode(ledPinRed, OUTPUT); | |
pinMode(ledPinYellow, OUTPUT); | |
pinMode(ledPinGreen, OUTPUT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ledPin = 3; | |
int valPot = 0; | |
void setup() { | |
} | |
void loop() { | |
valPot = analogRead(A0); | |
valPot = map(valPot, 0, 1023, 0, 255); | |
analogWrite(ledPin, valPot); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ledPin = 12; | |
int delayTime = 2000; | |
void setup() { | |
pinMode(ledPin,OUTPUT); | |
} | |
void loop() { | |
digitalWrite(ledPin, HIGH); | |
delay(delayTime); |