This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.
Here's the unedited original, translated to Github Markdown glory:
This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.
Here's the unedited original, translated to Github Markdown glory:
// constants won't change. They're used here to set pin numbers: | |
const int buttonPin = 2; // the number of the pushbutton pin | |
const int ledPin = 13; // the number of the LED pin | |
long prevTime =0; | |
// variables will change: | |
int buttonState = 0; // variable for reading the pushbutton status | |
void setup() { | |
// initialize the LED pin as an output: |
#include <IRremote.h> | |
//Variables: | |
IRrecv irrecv(10); //Set up the IR Reciever, call it irrecv and attach it to the correct pin | |
decode_results results; //Set up a variable to hold the results | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(9600); | |
irrecv.enableIRIn(); // Start the receiver |
int analogInPin = A0; // Analog input pin that the potentiometer is attached to | |
int btnPin = 2; | |
int buzzerPin = 6; | |
bool toggle =false; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(buzzerPin, OUTPUT); | |
} |
int analogInPin = A0; // Analog input pin that the potentiometer is attached to | |
int btnPin = 2; | |
int buzzerPin = 6; | |
bool toggle =false; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(buzzerPin, OUTPUT); | |
} |
int analogInPin = A0; // Analog input pin that the potentiometer is attached to | |
int btnPin = 2; | |
bool toggle =false; | |
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() | |
{ |
int analogInPin = A0; // Analog input pin that the potentiometer is attached to | |
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() | |
{ | |
int rawvoltage= analogRead(analogInPin); | |
float millivolts= rawvoltage * (5000/1023.0); |
int sensorPin = 2; | |
int LEDPin = 13; | |
int isTilted = 0; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(sensorPin, INPUT); | |
pinMode(LEDPin, OUTPUT); | |
} |
int sensorPin = 2; | |
int isTilted = 0; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(sensorPin, INPUT); | |
} | |
void loop() { | |
isTilted=digitalRead(sensorPin); |
int pinR = 10; | |
int pinG = 9; | |
int pinB = 11; | |
int btnPin = 2; | |
int isPressed =0; | |
void setup() { | |
pinMode(pinR, OUTPUT); | |
pinMode(pinG, OUTPUT); | |
pinMode(pinB, OUTPUT); |