Skip to content

Instantly share code, notes, and snippets.

View abhikpal's full-sized avatar

Abhik Pal abhikpal

View GitHub Profile
/*
* Joystick and the serial monitor.
*
* This sketch outputs data from the joystick at 9600 baud to the 'Serial Monitor' (the serial
* monitor needs to be opened to view this data).
*
* CIRCUIT:
* - Joystick VCC to Arduino 5V, joystick GND to Arduino GND
* - Joystick vertical axis to A0, horizontal to A1
* - Joystick pushbutton connected to digital pin 2 using a pull-up resistor
@abhikpal
abhikpal / obstacle-avoider.ino
Last active September 28, 2016 09:16
Arduino based obstacle avoider robot
/*
* OBSTACLE AVOIDER ROBOT
*
* A simple Arduino based obstacle avoider robot that uses two infrared distance sensors to
* "look for" obstacle and change its behavior accordingly. If the robot detects an obstacle to its
* left, it turns clockwise; if the obstacle is on the right, it turns anti-clockwise; and moves
* forward if no obstacle is found.
*
* Abhik Pal
* (abhik@ardubotics.com)
/*
* Music Visualizer ver2
* This sketch extracts values from the input audio stream
* which happens to give the same values as our output
* stream as "Stereo Mix" has been set as the default device.
* The values are used to draw waveforms representing the
* average, left and right channels and send the values to an
* Arduino which changes the brightness of a LED.
* This is an upgrade to the previous Music Visualizer Project
* at : http://theblubot.blogspot.com/2014/01/simple-music-visualizer.html
/*
* A Simple Monochromatic sound Visualizer
*
* This sketch plays a sound and sends the average
* values in the audio buffer as integer values to the arduino
* where an LED changes its brightness based on the values sent.
*
* This project is an extension to the "Glowing Dodecahedron"
* project and adds a bit of functionality to the dodecahedron.
* The "Glowing Dodecahedron" project is available with instructions
@abhikpal
abhikpal / Arduino_Example_1.ino
Created October 4, 2013 08:40
Code to supplement the "Interfacing Arduino from Processing" Tutorial
/*
* Interfacing Arduino from Processing
* Example 1 Arduino Sketch
*
* The Arduino listens for any data on the serial buffer.
* If any data is received it is stored in a char-variable.
* If the received value is 'H' then the led is turned on and
* if the received value is 'L' then the LED is turned off.
* No action is taken for other values.
*
@abhikpal
abhikpal / theClockProblem.c
Last active June 11, 2017 21:51
The Clock Problem Code
/*
* The Clock Problem
* To find the time when the hands of a clock make a specified angle.
*
* based on equation given by Khan Academy(www.khanacademy.org) user Just Keith
* M = (2/11) * (30*H +- 90)
*
* Code by Abhik Pal
* 17th September 2013
*/
@abhikpal
abhikpal / intruderAlert.ino
Last active December 22, 2015 23:59
Code for the talking intruder alert system.
/*
* Arduino Code for
* Simple Talking Intruder Alert System
*
* Abhik Pal
*/
#define pirPin 7 // PIR Sensor connected to pin 7
#define ledPin 13 // LED connected to pin 13