Skip to content

数据绘图显示异常 #1

@1198632013

Description

@1198632013
Snipaste_2023-11-05_16-25-15

示例代码 Arduino

/*
  for test 
  by Enzo
*/

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
}

float thisByte = 0.0f;

void loop() {
  Serial.print(" 0:");
  Serial.print(sin(thisByte)*100.0f);
  Serial.print(" 1:");
  Serial.print(cos(thisByte)*100.0f);
  Serial.print(" 2:");
  Serial.print(sin(thisByte)*50.0f);
  Serial.print(" 3:");
  Serial.print(cos(thisByte)*50.0f);
  Serial.print(" 4:");
  Serial.print(sin(thisByte));
  Serial.print("\n");
  
  delay(100);
  thisByte += 0.1f;
  if (thisByte == 360.0f) {    // you could also use if (thisByte == '~') {
    thisByte = 0.0f;
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions