Advertisement
Guest User

I2S send

a guest
Sep 18th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. static inline void ADC_Sampling(){
  2.   uint16_t i2s_read_buff[NUM_SAMPLES];
  3.   int num = i2s_read_bytes(I2S_NUM_0, (char*)i2s_read_buff,  NUM_SAMPLES * sizeof(uint16_t), portMAX_DELAY);
  4.   //collected_samples += num / sizeof(uint16_t);
  5.   if(Chart_is_ok_to_Send_Data && olvasunk_e){
  6.     for (int i=0;i<NUM_SAMPLES;i++) {
  7.       String json = "";
  8.       json += String((i2s_read_buff[i] & 0xFFF)/ (float)40.95);
  9.       json += "}";
  10.       webSocket.broadcastTXT(json.c_str(), json.length());
  11.     }
  12.    
  13.   }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement