Update files.
This commit is contained in:
commit
3c1e42ac53
20 files changed
+2433
No files matched your search
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// FILE: KT0803K_minimal.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: minimal demo
|
||||
// URL: https://github.com/RobTillaart/KT0803
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "Wire.h"
|
||||
#include "KT0803.h"
|
||||
|
||||
|
||||
KT0803K FM_SEND;
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
while(!Serial);
|
||||
Serial.println();
|
||||
Serial.println(__FILE__);
|
||||
Serial.print("KT0803_LIB_VERSION: ");
|
||||
Serial.println(KT0803_LIB_VERSION);
|
||||
Serial.println();
|
||||
|
||||
Wire.begin();
|
||||
|
||||
FM_SEND.begin();
|
||||
FM_SEND.setChannel(2000); // * 0.05 100.00 MHz
|
||||
FM_SEND.setMute(false);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// FILE: KT0803K_minimal.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: minimal demo hardcoded presets
|
||||
// URL: https://github.com/RobTillaart/KT0803
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "Wire.h"
|
||||
#include "KT0803.h"
|
||||
|
||||
|
||||
KT0803L FM_SEND;
|
||||
|
||||
// hardcoded presets adjust to your need.
|
||||
// note: presets by channel would take half the memory
|
||||
float preset[10] =
|
||||
{
|
||||
88.6, 91.3, 92.2, 96.0, 97.3,
|
||||
98.8, 100.1, 100.3, 105.4, 107.6
|
||||
};
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
while(!Serial);
|
||||
Serial.println();
|
||||
Serial.println(__FILE__);
|
||||
Serial.print("KT0803_LIB_VERSION: ");
|
||||
Serial.println(KT0803_LIB_VERSION);
|
||||
Serial.println();
|
||||
|
||||
Wire.begin();
|
||||
|
||||
FM_SEND.begin(preset[0], false);
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (Serial.available())
|
||||
{
|
||||
char c = Serial.read();
|
||||
|
||||
if (c == 'm') FM_SEND.setMute(false);
|
||||
if (c == 'M') FM_SEND.setMute(true);
|
||||
// select preset 0..9
|
||||
int p = c - '0'; // convert to digit
|
||||
if ((0 <= p) && (p <= 9)) FM_SEND.setFrequency(preset[p]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// FILE: KT0803_setFrequency.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: minimal demo
|
||||
// URL: https://github.com/RobTillaart/KT0803
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "Wire.h"
|
||||
#include "KT0803.h"
|
||||
|
||||
|
||||
KT0803K FM_SEND;
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
while(!Serial);
|
||||
Serial.println();
|
||||
Serial.println(__FILE__);
|
||||
Serial.print("KT0803_LIB_VERSION: ");
|
||||
Serial.println(KT0803_LIB_VERSION);
|
||||
Serial.println();
|
||||
|
||||
Wire.begin();
|
||||
|
||||
FM_SEND.begin();
|
||||
FM_SEND.setFrequency(105.75);
|
||||
FM_SEND.setMute(false);
|
||||
|
||||
Serial.print("Freq: ");
|
||||
Serial.println(FM_SEND.getFrequency());
|
||||
Serial.print("Channel: ");
|
||||
Serial.println(FM_SEND.getChannel());
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// FILE: KT0803_minimal.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: minimal demo
|
||||
// URL: https://github.com/RobTillaart/KT0803
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "Wire.h"
|
||||
#include "KT0803.h"
|
||||
|
||||
|
||||
KT0803 FM_SEND;
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
while(!Serial);
|
||||
Serial.println();
|
||||
Serial.println(__FILE__);
|
||||
Serial.print("KT0803_LIB_VERSION: ");
|
||||
Serial.println(KT0803_LIB_VERSION);
|
||||
Serial.println();
|
||||
|
||||
Wire.begin();
|
||||
|
||||
FM_SEND.begin();
|
||||
FM_SEND.setChannel(2000); // * 0.05 = 100.00 MHz
|
||||
FM_SEND.setMute(false);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// FILE: KT0803_setFrequency.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: minimal demo
|
||||
// URL: https://github.com/RobTillaart/KT0803
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "Wire.h"
|
||||
#include "KT0803.h"
|
||||
|
||||
|
||||
KT0803 FM_SEND;
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
while(!Serial);
|
||||
Serial.println();
|
||||
Serial.println(__FILE__);
|
||||
Serial.print("KT0803_LIB_VERSION: ");
|
||||
Serial.println(KT0803_LIB_VERSION);
|
||||
Serial.println();
|
||||
|
||||
Wire.begin();
|
||||
|
||||
FM_SEND.begin();
|
||||
FM_SEND.setFrequency(105.75);
|
||||
FM_SEND.setMute(false);
|
||||
|
||||
Serial.print("Freq: ");
|
||||
Serial.println(FM_SEND.getFrequency());
|
||||
Serial.print("Channel: ");
|
||||
Serial.println(FM_SEND.getChannel());
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// FILE: KT0803_sweep_2_seconds.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: minimal demo
|
||||
// URL: https://github.com/RobTillaart/KT0803
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "Wire.h"
|
||||
#include "KT0803.h"
|
||||
|
||||
|
||||
KT0803 FM_SEND;
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
while(!Serial);
|
||||
Serial.println();
|
||||
Serial.println(__FILE__);
|
||||
Serial.print("KT0803_LIB_VERSION: ");
|
||||
Serial.println(KT0803_LIB_VERSION);
|
||||
Serial.println();
|
||||
|
||||
Wire.begin();
|
||||
FM_SEND.begin();
|
||||
FM_SEND.setMute(false);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
// adjust to your local allowed frequencies
|
||||
for (float freq = 88.0; freq <= 108.0; freq += 0.1)
|
||||
{
|
||||
FM_SEND.setFrequency(freq);
|
||||
delay(2000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// FILE: KT0803_up_down.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: minimal demo
|
||||
// URL: https://github.com/RobTillaart/KT0803
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "Wire.h"
|
||||
#include "KT0803.h"
|
||||
|
||||
|
||||
KT0803 FM_SEND;
|
||||
|
||||
// connect two buttons to GND
|
||||
// adjust pins to your needs,
|
||||
uint8_t UP_PIN = 6;
|
||||
uint8_t DOWN_PIN = 7;
|
||||
float freq = 100.0;
|
||||
float newFreq = 100.0;
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
while(!Serial);
|
||||
Serial.println();
|
||||
Serial.println(__FILE__);
|
||||
Serial.print("KT0803_LIB_VERSION: ");
|
||||
Serial.println(KT0803_LIB_VERSION);
|
||||
Serial.println();
|
||||
|
||||
pinMode(UP_PIN, INPUT_PULLUP);
|
||||
pinMode(DOWN_PIN, INPUT_PULLUP);
|
||||
Wire.begin();
|
||||
|
||||
FM_SEND.begin(freq, false);
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
// adjust frequency with up and down button.
|
||||
uint8_t u = digitalRead(UP_PIN);
|
||||
uint8_t d = digitalRead(DOWN_PIN);
|
||||
if ((u == 0) && (d == 0))
|
||||
{
|
||||
newFreq = 100.0;
|
||||
}
|
||||
else if (u == 0)
|
||||
{
|
||||
newFreq += 0.1;
|
||||
if (newFreq > 108.0) newFreq = 108.0;
|
||||
}
|
||||
else if (d == 0)
|
||||
{
|
||||
newFreq -= 0.1;
|
||||
if (newFreq < 88.0) newFreq = 88.0;
|
||||
}
|
||||
if (newFreq != freq)
|
||||
{
|
||||
freq = newFreq;
|
||||
FM_SEND.setFrequency(freq);
|
||||
|
||||
Serial.print("Freq: ");
|
||||
Serial.print(FM_SEND.getFrequency());
|
||||
Serial.print("\t");
|
||||
Serial.println(FM_SEND.getChannel());
|
||||
|
||||
delay(100);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
Reference in new issue
Block a user