Devices & Components
Arduino Uno Rev3
Software & Tools
Visual Micro
Visual Studio 2017
Arduino IDE
Project description
Code
SerialDebuggerExample.ino
arduino
Main Sketch - just code to use with the Serial Debugging Tool in the examples shown
1 2 3double currentSinVal = 0.0; 4double currentCosVal = 0.0; 5int randomVal = 0; 6 7void setup() { 8 Serial.begin(115200); 9 randomSeed(millis()); 10 pinMode(13, OUTPUT); 11} 12 13void loop() { 14 currentSinVal = getSinValue(millis()); 15 currentCosVal = getCosValue(millis()); 16 randomVal += random(0, 100); 17 Serial.print(F("Random:")); 18 Serial.print(randomVal); 19 delay(100); 20} 21
Calcs.ino
arduino
Secondary INO file for use in the examples
1// Calculations kept in seperate ino 2 3double getSinValue(unsigned long millis) { 4 double newSin = 1+ sin(millis / 200); 5 return newSin * 90; 6} 7 8double getCosValue(unsigned long millis) { 9 double newCos = cos(millis / 200); 10 return newCos * 90; 11}
SerialDebuggerExample.ino
arduino
Main Sketch - just code to use with the Serial Debugging Tool in the examples shown
1 2 3double currentSinVal = 0.0; 4double currentCosVal = 0.0; 5int randomVal = 0; 6 7void setup() { 8 Serial.begin(115200); 9 randomSeed(millis()); 10 pinMode(13, OUTPUT); 11} 12 13void loop() { 14 currentSinVal = getSinValue(millis()); 15 currentCosVal = getCosValue(millis()); 16 randomVal += random(0, 100); 17 Serial.print(F("Random:")); 18 Serial.print(randomVal); 19 delay(100); 20} 21
Downloadable files
No Additional Wiring for Serial Debug
Just to show how nothing is needed beyond the USB lead to the PC from your board.
No Additional Wiring for Serial Debug

No Additional Wiring for Serial Debug
Just to show how nothing is needed beyond the USB lead to the PC from your board.
No Additional Wiring for Serial Debug

Comments
Only logged in users can leave comments