-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
示例代码 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
Labels
No labels