- Megjött a Razer DeathAdder egerek legfrissebb nemzedéke
- Ismét minimalista miditorony érkezett a Fractal Design műhelyéből
- Alakul a SpaceX Starlink európai ellenfele
- Digital Fingerprinting: Így buktat le a böngésződ a neten - Tech Percek #18
- Prezentálta PCI Express 6.0-s SSD-vezérlőjét a Silicon Motion
- Gaming notebook topik
- Házimozi belépő szinten
- Samsung LCD és LED TV-k
- Milyen belső merevlemezt vegyek?
- AMD Ryzen 9 / 7 / 5 / 3 5***(X) "Zen 3" (AM4)
- Milyen cserélhető objektíves gépet?
- Bambu Lab 3D nyomtatók
- AMD Ryzen 9 / 7 / 5 9***(X) "Zen 5" (AM5)
- Házi barkács, gányolás, tákolás, megdöbbentő gépek!
- AMD K6-III, és minden ami RETRO - Oldschool tuning
-
PROHARDVER!
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
Postas99 #23178 üzenetére
/* 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
- Gaming notebook topik
- Óra topik
- Házimozi belépő szinten
- Kínai és egyéb olcsó órák topikja
- Call of Duty: Black Ops 6
- Synology NAS
- Samsung LCD és LED TV-k
- Ubiquiti hálózati eszközök
- WoW avagy World of Warcraft -=MMORPG=-
- laskr99: Újrakezdem a processzor és videókártya szilícium magok fotózását
- További aktív témák...
- Asztali PC , i7 6700K , 1080 Ti 11GB , 32GB DDR4 , 500GB NVME , 500GB HDD
- Asztali PC , R5 8400F , RTX 3070 , 32GB DDR5 , 500GB NVME , 2TB HDD
- Legion Go 1TB
- Lenovo LOQ 15IRX9 - i5 13450HX, 16GB, RTX 4060 8G, 1TB M.2 (Gari: 2027.03.11.)
- LG 34WR55QK-B - 34" Ívelt VA - 3440x1440 - 100Hz 5ms - FreeSync Premium - HDR 10 - USB Type-C 65W
- BESZÁMÍTÁS! Intel Core i9 9900K 8 mag 16 szál processzor garanciával hibátlan működéssel
- 2db Dell PowerEdge R740 2U Rack Szerver és 3db Netapp FAS2040 NAS
- AKCIÓ! Apple Macbook Pro 15" 2018 i9 9850HK 32GB 500GB 560X 4GB garanciával hibátlan működéssel
- HP OMEN MAX 16T-AH000 - Ultra 9 275HX, 32GB, 1TB SSD, NVIDIA RTX 5090
- Azonnali készpénzes Intel i3 i5 i7 i9 12/13/14 gen processzor felvásárlás személyesen / csomagküldés
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest