Components and supplies
5 mm LED: Green
Arduino UNO
Tactile Switch, Top Actuated
Jumper wires (generic)
TEA5767
Speaker 3W 8ohm
9V adapter
I2C 16x2 Arduino LCD Display Module
Breadboard (generic)
Switch spst
Through Hole Resistor, 12 ohm
9V battery (generic)
TDA2822M amplifier
Project description
Code
Code
arduino
1/* 2 This example was based on the TEA5767 library published by 3 Marcos R. Oliveira at: https://github.com/mroger/TEA5767 4 This example was provided by Csongor Varga watch a video on this 5 example at: https://youtu.be/yp0HVGjakMs 6 This example is available at: https://github.com/nygma2004/tea5657_station_selector 7 Copyright 2014 Marcos R. Oliveira 8 Licensed under the Apache License, Version 2.0 (the "License"); 9 you may not use this file except in compliance with the License. 10 You may obtain a copy of the License at 11 http://www.apache.org/licenses/LICENSE-2.0 12 Unless required by applicable law or agreed to in writing, software 13 distributed under the License is distributed on an "AS IS" BASIS, 14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 See the License for the specific language governing permissions and 16 limitations under the License. 17*/ 18 19#include <EEPROM.h> 20#include <Wire.h> 21#include <TEA5767N.h> 22#include <LiquidCrystal_I2C.h> 23#define LED_PIN 3 //pin connected to LED terminal on the LCD 24 25LiquidCrystal_I2C lcd(0x27, 16, 2); 26 27//Constants: 28TEA5767N Radio = TEA5767N(); // Using standard I2C pins A4 and A5 29 30//Variables: 31int P1 = 2; 32int B2 = 4; 33float freq = 87.60; 34int address=0; 35 36void setup () { 37 //Init 38 lcd.init(); 39 lcd.backlight(); 40 pinMode(LED_PIN, OUTPUT); 41 analogWrite(LED_PIN, 50); //you can modify the value of LCD LED from 0 to 255 in order to regular the brightness contrast 42 43 44 lcd.setCursor(0, 0); 45 lcd.print(EEPROM.get(address,freq)); 46 lcd.setCursor(6, 0); 47 lcd.print("MHz"); 48 Radio.selectFrequency(EEPROM.get(address,freq)); 49 pinMode(P1, INPUT); 50 pinMode(B2, INPUT); 51} 52 53void loop () { 54 55 56 if (digitalRead(P1)==HIGH) { 57 freq+=0.1; 58 EEPROM.put(address, freq); 59 Radio.selectFrequency(EEPROM.get(address,freq)); 60 lcd.setCursor(0, 0); 61 lcd.print(EEPROM.get(address,freq)); 62 lcd.setCursor(6, 0); 63 lcd.print("MHz"); 64 65 } 66 67 else if(digitalRead(B2)==HIGH) { 68 freq-=0.1; 69 EEPROM.put(address, freq); 70 Radio.selectFrequency(EEPROM.get(address,freq)); 71 lcd.setCursor(0, 0); 72 lcd.print(EEPROM.get(address,freq)); 73 lcd.setCursor(6, 0); 74 lcd.print("MHz"); 75 } 76 77 78 }
Code
arduino
1/* 2 This example was based on the TEA5767 library published by 3 4 Marcos R. Oliveira at: https://github.com/mroger/TEA5767 5 This example was 6 provided by Csongor Varga watch a video on this 7 example at: https://youtu.be/yp0HVGjakMs 8 9 This example is available at: https://github.com/nygma2004/tea5657_station_selector 10 11 Copyright 2014 Marcos R. Oliveira 12 Licensed under the Apache License, Version 13 2.0 (the "License"); 14 you may not use this file except in compliance with 15 the License. 16 You may obtain a copy of the License at 17 http://www.apache.org/licenses/LICENSE-2.0 18 19 Unless required by applicable law or agreed to in writing, software 20 distributed 21 under the License is distributed on an "AS IS" BASIS, 22 WITHOUT WARRANTIES 23 OR CONDITIONS OF ANY KIND, either express or implied. 24 See the License for 25 the specific language governing permissions and 26 limitations under the License. 27*/ 28 29#include 30 <EEPROM.h> 31#include <Wire.h> 32#include <TEA5767N.h> 33#include <LiquidCrystal_I2C.h> 34#define 35 LED_PIN 3 //pin connected to LED terminal on the LCD 36 37LiquidCrystal_I2C lcd(0x27, 38 16, 2); 39 40//Constants: 41TEA5767N Radio = TEA5767N(); // Using standard I2C 42 pins A4 and A5 43 44//Variables: 45int P1 = 2; 46int B2 = 4; 47float freq = 48 87.60; 49int address=0; 50 51void setup () { 52 //Init 53 lcd.init(); 54 55 lcd.backlight(); 56 pinMode(LED_PIN, OUTPUT); 57 analogWrite(LED_PIN, 50); 58 //you can modify the value of LCD LED from 0 to 255 in order to regular the brightness 59 contrast 60 61 62 lcd.setCursor(0, 0); 63 lcd.print(EEPROM.get(address,freq)); 64 65 lcd.setCursor(6, 0); 66 lcd.print("MHz"); 67 Radio.selectFrequency(EEPROM.get(address,freq)); 68 69 pinMode(P1, INPUT); 70 pinMode(B2, INPUT); 71} 72 73void loop () { 74 75 76 77 if (digitalRead(P1)==HIGH) { 78 freq+=0.1; 79 EEPROM.put(address, 80 freq); 81 Radio.selectFrequency(EEPROM.get(address,freq)); 82 lcd.setCursor(0, 83 0); 84 lcd.print(EEPROM.get(address,freq)); 85 lcd.setCursor(6, 0); 86 87 lcd.print("MHz"); 88 89 } 90 91 else if(digitalRead(B2)==HIGH) 92 { 93 freq-=0.1; 94 EEPROM.put(address, freq); 95 Radio.selectFrequency(EEPROM.get(address,freq)); 96 97 lcd.setCursor(0, 0); 98 lcd.print(EEPROM.get(address,freq)); 99 lcd.setCursor(6, 100 0); 101 lcd.print("MHz"); 102 } 103 104 105 }
Downloadable files
Circuit diagram
The circuit diagram contains some parts not very accurate
Circuit diagram
Circuit diagram
Circuit diagram
Circuit diagram
The circuit diagram contains some parts not very accurate
Circuit diagram
Comments
Only logged in users can leave comments
valerioceccoli
1 Followers
•2 Projects
5
1
zgumushan
7 months ago
Good job