├── README.md ├── examples └── SimpleFixedFrequency │ └── SimpleFixedFrequency.ino ├── keywords.txt ├── library.properties ├── LICENSE └── src ├── TEA5767Radio.h └── TEA5767Radio.cpp /README.md: -------------------------------------------------------------------------------- 1 | # arduino_TEA5767 2 | Yet another Arduino library for the TEA5767 FM radio receiver modules. Super easy to use! 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/SimpleFixedFrequency/SimpleFixedFrequency.ino: -------------------------------------------------------------------------------- 1 | // TEA5767 Example 2 | 3 | #include 4 | #include 5 | 6 | TEA5767Radio radio = TEA5767Radio(); 7 | 8 | void setup() 9 | { 10 | Wire.begin(); 11 | radio.setFrequency(93.0); // pick your own frequency 12 | } 13 | 14 | void loop() 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map for TEA5767Radio 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | TEA5767Radio KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | setFrequency KEYWORD2 16 | -------------------------------------------------------------------------------- /library.properties: -------------------------------------------------------------------------------- 1 | name=ArduinoTEA5767 2 | version=1.0 3 | author=Simon Monk 4 | maintainer=Simon Monk 5 | sentence=A simple to use library for the TEA5767 I2C FM receiver IC. 6 | paragraph=It supports multiple devices and just wraps the I2C command to set the frequency. 7 | category=Device Control 8 | url=https://github.com/simonmonk/arduino_TEA5767 9 | architectures=* 10 | includes=ArduinoTEA5767.h 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Simon Monk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /src/TEA5767Radio.h: -------------------------------------------------------------------------------- 1 | /* 2 | TEA5767 I2C FM Radio Library 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | The latest version of this library can always be found at 19 | http://arduiniana.org. 20 | 21 | Simon Monk 2013 22 | */ 23 | 24 | #include 25 | 26 | #ifndef TEA5767Radio_h 27 | #define TEA5767Radio_h 28 | 29 | 30 | class TEA5767Radio 31 | { 32 | private: 33 | int _address; 34 | 35 | public: 36 | TEA5767Radio(); 37 | TEA5767Radio(int address); 38 | void setFrequency(float frequency); 39 | void setFrequency(); 40 | }; 41 | 42 | 43 | #endif -------------------------------------------------------------------------------- /src/TEA5767Radio.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | TEA5767 I2C FM Radio Library 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | The latest version of this library can always be found at 19 | http://arduiniana.org. 20 | 21 | 22 | Simon Monk 2013 23 | */ 24 | 25 | #include 26 | #include 27 | 28 | TEA5767Radio::TEA5767Radio(int address) 29 | { 30 | _address = address; 31 | } 32 | 33 | TEA5767Radio::TEA5767Radio() 34 | { 35 | _address = 0x60; 36 | } 37 | 38 | 39 | void TEA5767Radio::setFrequency(float frequency) 40 | { 41 | unsigned int frequencyB = 4 * (frequency * 1000000 + 225000) / 32768; 42 | byte frequencyH = frequencyB >> 8; 43 | byte frequencyL = frequencyB & 0XFF; 44 | Wire.beginTransmission(_address); 45 | Wire.write(frequencyH); 46 | Wire.write(frequencyL); 47 | Wire.write(0xB0); 48 | Wire.write(0x10); 49 | Wire.write(0x00); 50 | Wire.endTransmission(); 51 | delay(100); 52 | } 53 | --------------------------------------------------------------------------------