forked from irplus-remote/irplus-remote.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update website with esp32 info and updated arduino script
- Loading branch information
1 parent
df0bc65
commit c3548f3
Showing
10 changed files
with
249 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
html { | ||
overflow-y: scroll; | ||
} | ||
|
||
|
||
|
||
/* width */ | ||
::-webkit-scrollbar { | ||
width: 5px; | ||
height: 5px; | ||
} | ||
|
||
/* Track */ | ||
::-webkit-scrollbar-track { | ||
background: #f1f1f1; | ||
} | ||
|
||
/* Handle */ | ||
::-webkit-scrollbar-thumb { | ||
background: #888; | ||
} | ||
|
||
/* Handle on hover */ | ||
::-webkit-scrollbar-thumb:hover { | ||
background: #555; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,27 +7,29 @@ | |
|
||
<link rel="shortcut icon" href="favicon.ico"> | ||
|
||
<link href="app.css" rel="stylesheet" crossorigin="anonymous"> | ||
|
||
<!-- Bootstrap CSS --> | ||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous"> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous"> | ||
|
||
<title>irplus - Infrared remote</title> | ||
</head> | ||
<body style="padding-top: 56px;"> | ||
|
||
<!-- Optional JavaScript --> | ||
<!-- jQuery first, then Popper.js, then Bootstrap JS --> | ||
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> | ||
<!-- https://github.com/FezVrasta/popper.js --> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha256-98vAGjEDGN79TjHkYWVD4s87rvWkdWLHPs5MC3FvFX4=" crossorigin="anonymous"></script> | ||
<!-- https://github.com/twbs/bootstrap --> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script> | ||
|
||
<script src="app.js" crossorigin="anonymous"></script> | ||
|
||
<div data-include="navbar.html"></div> | ||
<div class="container"> | ||
|
||
<div data-include="navbar.html"></div> | ||
|
||
<div class="contentDiv" style="margin: 30px;"> | ||
<div data-include="home.html"></div> | ||
</div> | ||
|
||
<div class="contentDiv" style="margin: 30px;"> | ||
<div data-include="home.html"></div> | ||
</div> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
/*Author: [email protected] | ||
* MIT-Licence | ||
* You will need to install this library on your PC before compiling this sketch: | ||
* https://github.com/z3t0/Arduino-IRremote | ||
*/ | ||
MIT-Licence | ||
You will need to install this library on your PC before compiling this sketch: | ||
https://github.com/Arduino-IRremote/Arduino-IRremote | ||
Tested with 3.3.0 Installed with Tools -> Manage Library | ||
*/ | ||
#include <SoftwareSerial.h> | ||
#include <IRremote.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#define rxPin 10 | ||
#define txPin 11 | ||
IRsend irsend; | ||
|
||
SoftwareSerial btSerial(rxPin, txPin); | ||
//---------------------------------------------------------------- | ||
int dataPosition = 0; | ||
|
@@ -19,39 +20,41 @@ byte dataBytes[dataUpperLimit]; | |
void setup() { | ||
//Serial.begin(9600);//Enable/disable console serial | ||
btSerial.begin(9600); | ||
pinMode(LED_BUILTIN, OUTPUT); | ||
//WARNING: USE THE CORRECT GPIO PIN. HERE 3 IS USED! | ||
IrSender.begin(3, true); // Specify send pin and enable feedback LED at default feedback LED pin | ||
} | ||
//------------------------------------------------------------------- | ||
void loop() { | ||
if (btSerial.available() > 0) { | ||
dataBytes[dataPosition] = btSerial.read(); | ||
//stop reading at this point | ||
if(dataPosition > 0 && (dataPosition % 2) != 0 && dataBytes[dataPosition-1] == 255 && dataBytes[dataPosition] == 255){ | ||
//create array | ||
unsigned int carrierFrequency = 0; | ||
unsigned int dataBuffer[(dataPosition/2)-1]; | ||
int byteCounter = 0; | ||
for (int i = 0; i < dataPosition/2; i++) { | ||
int currentInt = word(dataBytes[byteCounter+1],dataBytes[byteCounter]); | ||
if(i == 0){ | ||
carrierFrequency = currentInt; | ||
} else { | ||
dataBuffer[i-1] = currentInt; | ||
} | ||
byteCounter = byteCounter + 2; | ||
} | ||
dataBytes[dataPosition] = btSerial.read(); | ||
//stop reading at this point | ||
if (dataPosition > 0 && (dataPosition % 2) != 0 && dataBytes[dataPosition - 1] == 255 && dataBytes[dataPosition] == 255) { | ||
//create array | ||
unsigned int carrierFrequency = 0; | ||
unsigned int dataBuffer[(dataPosition / 2) - 1]; | ||
int byteCounter = 0; | ||
for (int i = 0; i < dataPosition / 2; i++) { | ||
int currentInt = word(dataBytes[byteCounter + 1], dataBytes[byteCounter]); | ||
if (i == 0) { | ||
carrierFrequency = currentInt; | ||
} else { | ||
dataBuffer[i - 1] = currentInt; | ||
} | ||
byteCounter = byteCounter + 2; | ||
} | ||
//send IR | ||
digitalWrite(LED_BUILTIN, HIGH); | ||
int carrierKhz = carrierFrequency/1000; | ||
irsend.sendRaw(dataBuffer, dataPosition/2, carrierKhz); | ||
digitalWrite(LED_BUILTIN, LOW); | ||
|
||
int carrierKhz = carrierFrequency / 1000; | ||
|
||
IrSender.sendRaw(dataBuffer, sizeof(dataBuffer) / sizeof(dataBuffer[0]), carrierKhz); // Note the approach used to automatically calculate the size of the array. | ||
|
||
//reset reading data | ||
dataPosition = 0; | ||
memset(dataBytes, 0, dataUpperLimit); | ||
btSerial.write(1); | ||
} else { | ||
dataPosition++; | ||
} | ||
} | ||
|
||
} else { | ||
dataPosition++; | ||
} | ||
} | ||
} |
Oops, something went wrong.