Hirdetés
- MasterDeeJay: Harc a DDR5 árak ellen
- Sub-ZeRo: Euro Truck Simulator 2 & American Truck Simulator 1 (esetleg 2 majd, ha lesz) :)
- djculture: Éhezők ssd és memória viadala.
- Luck Dragon: Asszociációs játék. :)
- Real Racing 3 - Freemium csoda
- sziku69: Fűzzük össze a szavakat :)
- sziku69: Szólánc.
- bambano: Bambanő háza tája
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- f(x)=exp(x): A laposföld elmebaj: Vissza a jövőbe!
-
LOGOUT
Arduino hardverrel és szoftverrel foglakozó téma. Minden mikrovezérlő ami arduinoval programozható, és minden arduino program, board, és hardverrel kapcsolatos kérdések helye.
Új hozzászólás Aktív témák
-
Postas99
őstag
válasz
Wolfram
#23177
üzenetére
Hackster.io, nem emékszem hogy fizettem-e valaha is érte. Lehet csak regisztrációt igényel.
Bemásolom ide a kódot. De valamiért szétesik./* Audio streamer with ESP32 and Adafruit elected microphone board. * Created by Julian Schroeter. */ #include <Arduino.h> #include <WiFi.h> #include <driver/adc.h> #define AUDIO_BUFFER_MAX 800 uint8_t audioBuffer[AUDIO_BUFFER_MAX]; uint8_t transmitBuffer[AUDIO_BUFFER_MAX]; uint32_t bufferPointer = 0; const char* ssid = "YOUR SSID"; const char* password = "YOUR PASSWORD"; const char* host = "YOUR SERVER IP ADDRESS"; bool transmitNow = false; WiFiClient client; hw_timer_t * timer = NULL; // our timer portMUX_TYPE timerMux = portMUX_INITIALIZER_UNLOCKED; void IRAM_ATTR onTimer() { portENTER_CRITICAL_ISR(&timerMux); // says that we want to run critical code and don't want to be interrupted int adcVal = adc1_get_voltage(ADC1_CHANNEL_0); // reads the ADC uint8_t value = map(adcVal, 0 , 4096, 0, 255); // converts the value to 0..255 (8bit) audioBuffer[bufferPointer] = value; // stores the value bufferPointer++; if (bufferPointer == AUDIO_BUFFER_MAX) { // when the buffer is full bufferPointer = 0; memcpy(transmitBuffer, audioBuffer, AUDIO_BUFFER_MAX); // copy buffer into a second buffer transmitNow = true; // sets the value true so we know that we can transmit now } portEXIT_CRITICAL_ISR(&timerMux); // says that we have run our critical code } void setup() { Serial.begin(115200); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); Serial.println("MY IP address: "); Serial.println(WiFi.localIP()); adc1_config_width(ADC_WIDTH_12Bit); // configure the analogue to digital converter adc1_config_channel_atten(ADC1_CHANNEL_0, ADC_ATTEN_0db); // connects the ADC 1 with channel 0 (GPIO 36) const int port = 4444; while (!client.connect(host, port)) { Serial.println("connection failed"); delay(1000); } Serial.println("connected to server"); timer = timerBegin(0, 80, true); // 80 Prescaler timerAttachInterrupt(timer, &onTimer, true); // binds the handling function to our timer timerAlarmWrite(timer, 125, true); timerAlarmEnable(timer); } void loop() { if (transmitNow) { // checks if the buffer is full transmitNow = false; client.write((const uint8_t *)audioBuffer, sizeof(audioBuffer)); // sending the buffer to our server }}
Új hozzászólás Aktív témák
- PlayStation 5
- Synology NAS
- MasterDeeJay: Harc a DDR5 árak ellen
- 5.1, 7.1 és gamer fejhallgatók
- Lexus, Toyota topik
- Hobby rádiós topik
- Maduro szerint venezuelai gyerekek gyártják majd az NVIDIA chipjeit
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- Milyen processzort vegyek?
- Spórolós topik
- További aktív témák...
- Latitude 5520 27% 15.6" FHD IPS érintő i7-1185G7 16GB 256GB NVMe ujjlolv IR kam gar
- Lenovo Thinkpad T14 Gen3 14" FHD+ IPS i7-1265U 16GB 512GB NVMe gar
- Gamer PC-Ryzen 9 7800X3D+RX 9070 XT+32GB DDR5 +1 TB SSD+1000W GOLD +240 AIO/ Beszámítás
- Thinkpad P1 Gen5 16" 4K+ IPS i7-12800H RTX A4500 32GB 1TB NVMe ujjlolv IR kam gar
- ID Cooling Frozn A610 minden tartozékával, jótállással
- GYÖNYÖRŰ iPhone 13 mini 128GB Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS4188, 94% Akkumulátor
- ÁRGARANCIA!Épített KomPhone Ryzen 5 7500F 32/64GB DDR5 RTX 5060 8GB GAMER PC termékbeszámítással
- Dell Latitude 5400 14" FHD IPS, i5 8365U, 8-16GB RAM, SSD, jó akku, számla, 6 hó gar
- Samsung Galaxy S20 Ultra / 12/128GB / Kártyafüggetlen / 12Hó Garancia
- BESZÁMÍTÁS! ASUS H510M i3 10105F 16GB DDR4 512GB SSD RX 590 8GB ZALMAN T4 Plus ADATA 600W
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: ATW Internet Kft.
Város: Budapest
ekkold
