Skip to content

Instantly share code, notes, and snippets.

View Resistor-01's full-sized avatar

Resistor-01

  • Joined May 1, 2026
View GitHub Profile
@Resistor-01
Resistor-01 / README
Created May 1, 2026 22:11
Line Marking Vehicle/Robot Source Code Final
# Line-Marking Vehicle Robot Arduino Code
## Project Description
The Arduino code program controls the movement of the model robot that is used to mark lines. The robot is provided with an array of five sensors for line tracking, a motor driver for driving the DC motors, speed control through potentiometer, and a NeoPixel LED strip for indicating the selected speed.
## Main Features
- Reads five analog reflectance sensors.
- Calculates the robot’s position relative to the line.
- Adjusts motor speeds to stay centered on the path.
- Uses a potentiometer for variable speed control.
@Resistor-01
Resistor-01 / gist:a87e343f69e5481b8b4e70d23b91cbfb
Created May 1, 2026 19:45
Line Marking Vehicle Source Code
#include <Adafruit_NeoPixel.h> // Includes the Adafruit NeoPixel library so the LED strip can be controlled.
#define LED_PIN 3 // Sets the Arduino pin connected to the NeoPixel data line.
#define NUMPIXELS 8 // Sets the number of NeoPixels in the LED strip.
Adafruit_NeoPixel pixels(NUMPIXELS, LED_PIN, NEO_GRB + NEO_KHZ800); // Creates the NeoPixel object using the number of LEDs, pin, and LED signal type.
// Sensors: S1 = left, S5 = right // Notes the physical sensor order from left to right.
const int S1 = A5; // Assigns the far-left sensor to analog pin A5.
const int S2 = A4; // Assigns the left-center sensor to analog pin A4.