Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - REDLINETECH

#1
ของผมครับ ใน usbd_cdc_if.c

static int8_t CDC_Receive_FS (uint8_t* Buf, uint32_t *Len)
{
  /* USER CODE BEGIN 6 */
   //********************************************************
   int a = 0;
   for (a = 0; a < 8; a++)
   {
    Receive_Data[a] = Buf[a];
      if(Buf[0] == 'P')
      {
         if(Buf[1] == '0') Press[a] = Buf[a];
         if(Buf[1] == '1') Back_Press[a] = Buf[a];
      }
      if(Buf[0] == 'S') Speed[a] = Buf[a];
      if(Buf[0] == 'H') Heater_Out[a] = Buf[a];
      
   }
   //*********************************************************
#2
ผมใช้ CUBE MX ตั้งคอนฟิคก่อนครับ แล้วก็เขียนคำสั่งเปิดการอ่านเอนโค๊ดเดอร์ ได้เลย