Arduino tutorials

Analog Joystick

Connect an analog joystick to an Arduino. Read two analog values (x- and y-position) and a switch using a method witch does not hog the processor during the whole ADConversion. The capacitor reduces digital noise on the analog readings. Code static const byte ADC_CHANNEL_JOYSTICK_X = 0; static const byte ADC_CHANNEL_JOYSTICK_Y = 1; static const byte ADC_CHANNEL_MAX = 2; […]

Read More
Arduino tutorials

Read a pot, print to Serial Monitor

The USB connection is used for serial communication between Arduino and computer. The potentiometer pin 2 is connected to Arduino pin A0. analogRead is then used to measure the voltage at the pin. (The potentiometer rating doesn’t matter, but avoid lower resistances than 5k, so you don’t get an uneconomically high current flow.) You will get a value between 0 and 1023 (where 0 equals ground […]

Read More
Arduino tutorials

Read a pot, control 5 LEDs

The pot controls which LED is turned on. The pot is connected to Arduino pin A0. analogRead is used to measure the voltage at A0. You will get a value between 0 and 1023 (where 0 equals ground and 1023 equals +5 volts).  The analog range is divided into 5 sections (1023 / 5). Five LEDs are connected to the digital pins 2, 3, 4, 7 […]

Read More
Arduino tutorials

Light sensor, LDR

The light sensor is also called a light-dependent resistor (LDR) or photocell. It is connected to Arduino pin A0. analogRead measures the voltage at the pin. You will get a value between 0 and 1023 (where 0 equals ground and 1023 equals +5 volts). Changing the type of lamps and ambient light will give a bit of variation in your readings. In many cases […]

Read More

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.