Skip to content

Instantly share code, notes, and snippets.

@jpliew
jpliew / 101-rx-samples.md
Created March 20, 2022 06:44 — forked from omnibs/101-rx-samples.md
101 Rx Samples in C#

101 Rx Samples in C#

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:

101 Rx Samples - a work in progress

@jpliew
jpliew / TUT6-1C.ino
Created April 22, 2020 03:08
Tutorial 6 - 1C
// 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:
@jpliew
jpliew / irremote.ino
Created April 9, 2020 00:45
IRRemote
#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
@jpliew
jpliew / TUT4-1D.ino
Created March 30, 2020 04:51
Tutorial 4 - 1D
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);
}
@jpliew
jpliew / TUT4-1C.ino
Created March 30, 2020 04:14
Tutorial 4 - 1C
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);
}
@jpliew
jpliew / TUT4-1B.ino
Created March 30, 2020 03:50
Tutorial 4 - 1B
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()
{
@jpliew
jpliew / TUT4-1A.ino
Created March 30, 2020 03:10
Tutorial 4 - 1A
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);
@jpliew
jpliew / TUT3-2B.ino
Created March 25, 2020 06:45
Tutorial 3 - 2B
int sensorPin = 2;
int LEDPin = 13;
int isTilted = 0;
void setup() {
Serial.begin(9600);
pinMode(sensorPin, INPUT);
pinMode(LEDPin, OUTPUT);
}
@jpliew
jpliew / TUT3-2A.ino
Created March 25, 2020 06:41
Tutorial 3 - 2A
int sensorPin = 2;
int isTilted = 0;
void setup() {
Serial.begin(9600);
pinMode(sensorPin, INPUT);
}
void loop() {
isTilted=digitalRead(sensorPin);
@jpliew
jpliew / TUT3-1D.ino
Created March 25, 2020 06:27
Tutorial 3 - 1D
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);