Programs for basic Arduino sketches along with the circuit images.
- Programs are well documented to be self explanatory.
- Pin numbers are mentioned in the code itself for the inputs and outputs.
- Serial.begin() - Opens the serial port for data transmission.
- Serial.print() - Prints statements on the Serial monitor. Must use Serial.begin() in setup before using this.
- pinMode() - Sets the given pin component to INPUT, OUTPUT or INPUT_PULLUP.
- digitalRead() - Returns HIGH or LOW based on the component connected to the corresponding pin being ON or OFF respectively.
- digitalWrite() - Sets the value of the connected component on the given pin to HIGH ot LOW as specified.
- analogRead() - Reads the value from the specified analog pin.
- analogWrite() - Writes an analog value (e.g. LED 0-255) to the connected component.
- delay() - Adds a specified millisecond pause to the program. (use delayMicroseconds() for shorter unit duration)
- tone() - Play the specified frequency (used on buzzer or speaker) until noTone() is called.
- pulseIn() - Waits for a HIGH or LOW value on a given pin and returns the duration of pulse.
- pitches - contains common notes used for playing melodies.
- Servo - provides methods to control servo motors.
- Keypad - adds methods for matrix-style keyboards.
- RGB Fade - Change RGB LED from red to green to blue in a loop with a delay.
- LED 1 Button - Turn LED on or off using a button.
- LED 2 Buttons - Turn LED on or off using two separate buttons.
- Active Buzzer - Use an active buzzer to play Twinkle, twinkle, little star. Here is a list of other melodies that can be played: Songs for Arduino.
- Passive Buzzer - Play do re me fa so la ti do using a passive buzzer.
- Tilt Ball Switch - Turn an LED on or off based on the orientation of the tilt ball switch.
- Servo Motor - Rotate a servo motor in sweep motion and turn on LEDs depending on the angle.
- Ultrasonic Sensor - Get an untrasonic sensor to measure distance from an object without using libraries. Many libraries can be found for the same when looking for "HC-SR04".
- 4x4 Keypad - Register input from a 4x4 keypad using the Keypad library.
- Analog Joystick - Register coordinates and button press input from an analog joystick.