-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spectrum analyzer #86
Comments
Very nice!!! How you added it? How is possible edit custom display positions and text ? Can you kick me little bit? I want to my project add when you connect it to power it boot, connect wifi etc and stay stopped and just show date, time, day, after button press it start play radio... |
Hi, |
Any chance you'd post your code for loading the patch/plugin? I've been toying with the idea of doing this for a while, but haven't had a chance to dive in. |
Hi koskee, |
Awesome. I'll keep my eyes open for an update in that case. I'm also not in any rush, but thanks in advance. |
@MirkoDalmonte Did you ever get around to posting code for this? Still very much interested.. |
Hi @koskee, sorry for the delay... //*************************************************************************************************** #include <nvs.h> // Color definitions for the TFT screen (if used) //************************************************************************************************** //************************************************************************************************** struct scrseg_struct // For screen segments enum qdata_type { QDATA } ; // datatyp in qdata_struct struct ini_struct struct WifiInfo_t // For list with WiFi info struct nvs_entry struct nvs_page // For nvs entries uint32_t Unused[5] ; struct keyname_t // For keys in NVS //************************************************************************************************** enum datamode_t { INIT = 1, HEADER = 2, DATA = 4, // State for datastream // Global variables #define TFTSECS 15 progpin_struct progpin[] = // Input pins and programmed function struct touchpin_struct // For programmable input pins //************************************************************************************************** //************************************************************************************************** protected:
public: //************************************************************************************************** VS1053::VS1053 ( uint8_t _cs_pin, uint8_t _dcs_pin, uint8_t _dreq_pin, uint8_t _shutdown_pin ) : uint16_t VS1053::read_register ( uint8_t _reg ) const control_mode_on() ; void VS1053::write_register ( uint8_t _reg, uint16_t _value ) const bool VS1053::sdi_send_buffer ( uint8_t* data, size_t len ) data_mode_on() ; void VS1053::sdi_send_fillers ( size_t len ) data_mode_on() ; void VS1053::wram_write ( uint16_t address, uint16_t data ) uint16_t VS1053::wram_read ( uint16_t address ) bool VS1053::testComm ( const char *header ) dbgprint ( header ) ; // Show a header void VS1053::begin() void VS1053::LoadUserCode( const unsigned short* iplugin, uint16_t sizea) { void VS1053::getBands () void VS1053::setVolume ( uint8_t vol ) //if ( vol != curvol ) void VS1053::setTone ( uint8_t *rtone ) // Set bass/treble (4 nibbles) for ( i = 0 ; i < 4 ; i++ ) void VS1053::startSong() } bool VS1053::playChunk ( uint8_t* data, size_t len ) void VS1053::stopSong() sdi_send_fillers ( 2052 ) ; void VS1053::softReset() void VS1053::printDetails ( const char *header ) dbgprint ( header ) ; // The object for the MP3 player //************************************************************************************************** //************************************************************************************************** //************************************************************************************************** //************************************************************************************************** nvsopen() ; // Be sure to open nvs //************************************************************************************************** //dbgprint ( "Setstring for %s: %s", key, val.c_str() ) ; //************************************************************************************************** if ( nvssearch ( oldk ) ) // Old key in nvs? //************************************************************************************************** while ( xSemaphoreTake ( SPIsem, ctry ) != pdTRUE ) ; // Claim SPI bus //************************************************************************************************** //************************************************************************************************** specchunk.datatyp = func ; // Put function in datatyp //************************************************************************************************** nvsopen() ; // Be sure to open nvs //************************************************************************************************** void tftset ( uint16_t inx, String& str, int color = -1) //************************************************************************************************** if ( ascii <= 0x7F ) // Standard ASCII-set 0..0x7F handling //************************************************************************************************** for ( i = 0 ; s[i] ; i++ ) // For every input character //************************************************************************************************** for ( i = 0 ; s[i] ; i++ ) // For every input character //************************************************************************************************** va_start ( varArgs, format ) ; // Prepare parameters //************************************************************************************************** if ( hostreq ) // Host request already set? //************************************************************************************************** SD_currentnode = nodeID ; // Save current node //************************************************************************************************** if ( strcmp ( dirname, "/" ) == 0 ) // Are we at the root directory? //************************************************************************************************** //************************************************************************************************** dbgprint ( "Scan Networks" ) ; // Scan for nearby networks //************************************************************************************************** if ( datamode & ( INIT | HEADER | DATA | // Test op playing //************************************************************************************************** if ( ++count10sec == 100 ) // 10 seconds passed?
} //************************************************************************************************** t1 = micros() ; // Get current time //************************************************************************************************** //************************************************************************************************** void IRAM_ATTR isr_enc_turn() //************************************************************************************************** ceckstreamtitle((char*)ml);
} //************************************************************************************************** //************************************************************************************************** claimSPI ( "connecttohost" ) ; //************************************************************************************************** //************************************************************************************************** WifiInfo_t winfo ; // Entry from wifilist WiFi.disconnect() ; // After restart the router could //************************************************************************************************** p = dbgprint ( "OTA update Started" ) ; //************************************************************************************************** sprintf ( tkey, "preset_%02d", preset ) ; // Form the search key //************************************************************************************************** while ( ( contents = readhostfrompref ( ini_block.newpreset ) ) == "" ) //************************************************************************************************** for ( i = 0 ; ( pinnr = progpin[i].gpio ) >= 0 ; i++ ) // Scan for all programmable pins
} //************************************************************************************************** while ( ( pin = progpin[i].gpio ) >= 0 ) // Find entry for requested pin //************************************************************************************************** for ( i = 0 ; klist[i].gname ; i++ ) // Loop trough all I/O related keys //************************************************************************************************** i = 0 ; //************************************************************************************************** while ( Serial.available() ) // Any input seen? //************************************************************************************************** if ( ( millis() - oldmillis ) < 100 ) // Debounce //************************************************************************************************** if ( ir_value ) // Any input? //************************************************************************************************** for ( i = 0 ; i < 100 ; i++ ) // Examine wifi_00 .. wifi_99 //************************************************************************************************** sprintf ( pnr, "%02d", ini_block.newpreset ) ; // Current preset //************************************************************************************************** for ( i = 0 ; i < 100 ; i++ ) // Max 99 presets //************************************************************************************************** //************************************************************************************************** while ( tr[i][0] ) // Loop trough keys to be translated //************************************************************************************************** while ( offset < nvs->size )
} //************************************************************************************************** for ( i = 0 ; i < n - 1 ; i++ ) // Examine all keys //************************************************************************************************** keynames.clear() ; // Clear the list
} //************************************************************************************************** Serial.begin ( 115200 ) ; // For debug //************************************************************************************************** if ( forcestart || ( i == len ) ) // Time to read new buffer //************************************************************************************************** nvsclear() ; // Remove all preferences //************************************************************************************************** if ( http_reponse_flag ) //************************************************************************************************** if ( !cmdclient.connected() ) // Action if client is connected //************************************************************************************************** sel += selstr ; // Form searchstring //************************************************************************************************** String stationServer = "" ; // Radio stream server stop_mp3client() ; // Stop any current wificlient connections. //************************************************************************************************** if ( ( millis() - savetime ) < 600000 ) // 600 sec is 10 minutes //************************************************************************************************** if ( enc_menu_mode != VOLUME && enc_menu_mode != MENU ) // In default mode? //************************************************************************************************** // Try to keep the Queue to playtask filled up by adding as much bytes as possible } void displaymenu(int x) //************************************************************************************************** void forceStop() //************************************************************************************************** while ( ( b = *str++ ) ) // Search to end of string //************************************************************************************************** if (datamode == STOPREQD || datamode == STOPPED) // STOP requested? //************************************************************************************************** //************************************************************************************************** dbgprint ( "FileRequest received %s", pagename.c_str() ) ; //************************************************************************************************** if ( ( inx = str.indexOf ( "#" ) ) >= 0 ) // Comment line or partial comment? //************************************************************************************************** value = strstr ( str, "=" ) ; // See if command contains a "=" //************************************************************************************************** strcpy ( reply, "Command accepted" ) ; // Default reply
} //************************************************************************************************** //************************************************************************************************** //**************************************************************************************************
} //**************************************************************************************************
} void displayvolumestop()
} //************************************************************************************************** if ( str[0] == '\0' ) // Empty string? //************************************************************************************************** if ( inx == 0 ) // Topline is shorter
} //************************************************************************************************** if ( tft ) // TFT used? //************************************************************************************************** //************************************************************************************************** if (timeLineFileLength > 2048 ) //**************************************************************************************************
} //************************************************************************************************** void displaysignal() void drawdot(uint8_t posx, uint8_t posy, int color) //************************************************************************************************** void silentrecon() //************************************************************************************************** if ( ( tft != NULL ) && tft_update_req ) // Need to update TFT? //************************************************************************************************** void searchId3() void searchId3V2() } void searchId3V1() void readFile(char * bufferid3, uint32_t adress, uint32_t lenght) String storeId3 (int siz) unsigned int btoint(char* bytes, int sizes, int offset)
} int int_decode(int values)
} String isoToAscii (char car) |
This is the PATCHES file: // PATCHES const unsigned short analizer[1000] PROGMEM = { /* Compressed plugin /
|
@MirkoDalmonte Hi Mirko, thank you for sharing your code with the community. However I think posting the whole source code into this discussion is maybe not the best way to do that. |
Hi, I don't have time to do that, sorry... |
@MirkoDalmonte Ohh excellent! Looks like it was my turn getting caught with my head in the clouds, as I only now noticed your response.. So a big ( and very delayed) thank you. I will give it a try and see how it goes. |
@koskee Was the spectrum analyzer uploaded? |
Hello I would like to know if anyone managed to use the pasted spectrum analyzer code , I cant compile it Thanks |
Super project ESP Radio&Spectrum analyzer.... |
I just adapted and updated the code to have Spectrum analyzer Enjoy programming under CLion / PlateformeIO |
Wowwww!!!
Great job!!!!
Thank you!
Mirko
Il gio 28 mag 2020, 13:10 Lotfi <[email protected]> ha scritto:
… I just adapted and updated the code to have Spectrum analyzer
https://github.com/blotfi/ESP32-Radio-with-Spectrum-analyzer
Enjoy
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#86 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHBIZCMST2VBQFFDFFWOOGDRTZBC3ANCNFSM4EQJ64GQ>
.
|
Hello @blotfi is there a reason why you have not used all the TFT width ? or its because initial code was for a portrait TFT mode Thanks |
better ask for this fork in : https://github.com/blotfi/ESP32-Radio-with-Spectrum-analyzer/issues |
I also added a video to explain this part: |
check my remote control : |
Spectrum analyzer is not essential but it is beautiful :)
https://m.youtube.com/watch?v=mSrDDmvLRfI
The text was updated successfully, but these errors were encountered: