The serial monitor (Ctrl+Shift+M) is not working for the follow code. Otherwise the code works for the servo.
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 10; // variable to store the servo position
void setup() {
myservo.attach(10); // attaches the servo on pin 10 to the servo
Serial.println("Hello World");
}
void loop() {
for (pos = 10; pos <= 170; pos += 2) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 170; pos >= 10; pos -= 2) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
Neither Ctrl+Shift+M nor the Serial Monitor button on the IDE work for this corrected code:
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 10; // variable to store the servo position
void setup() {
myservo.attach(10); // attaches the servo on pin 10 to the servo
Serial.begin(9600);
delay(25);
Serial.println("Hello World");
}
void loop() {
for (pos = 10; pos <= 170; pos += 2) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 170; pos >= 10; pos -= 2) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
I am using IDE 1.8.3 on Windows 10. I tried this same sketch on another windows 10 computer running 1.8.1 and it works: Serial Monitor window comes up with "Hello World".
1.8.3 was released 5/31/17. I can't believe that it has been in service for over 2 months and someone just realizes that the Serial Monitor does not work with Windows 10.
Try a reinstall of 1.8.3 before posting an official bug report.
Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags: [code]`` [color=blue]// your code is here[/color] ``[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.
Do you see any new output in the black console window at the bottom of the Arduino IDE window after you try to open Serial Monitor? If so, please post it here using code tags.