Ah Crap, I read that title as using Two Serial ports, since At Mega has two ports. can I shunt the data of one Serial.read() to print that out in the second Serial port and view that in the serial monitor? It be helpful to he able to see the incoming data, while using it...
i have been watching your workshop it is great i am having a problem when i try to manage my library or upload to my library it keep saying cc.arduino.contribuion.librery please can you help
int ledPin = 3; int buttonPin = 2; int potPin = A0; void setup() { // setup pin modes pinMode(ledPin, OUTPUT); pinMode(buttonPin, INPUT_PULLUP); pinMode(potPin, INPUT); // initialise serial port with baud rate of 9600 Serial.begin(9600); } void loop() { // read the state of buttonPin and store it as buttonState (0 or 1) int buttonState = digitalRead(buttonPin);
// read the value of the pot, divide it by 4, and store it as potValue int potValue = analogRead(potPin); int filteredPotValue = potValue / 4; // turn led on with the value of potValue analogWrite(ledPin,filteredPotValue); // print the value of the button Serial.print("Button: "); Serial.print(buttonState); Serial.print(" "); // print the value of the pot Serial.print("Pot: "); Serial.print(potValue); Serial.print(" "); // print the value of the pot / 4 with a line return at the end Serial.print("Pot/4: "); Serial.println(filteredPotValue); }
Thanks for the upload
sorry for my English
does the the serial monitor function only when arduino is connected with the PC?
Yes
Very helpful.
Can you tell me how can I erase the old data from my Arduino Uno board to upload a new one
No need ! Upload new code u want👍👍👍
why you don't use the auto format option after copying the sketch ?
Can't u use ctrl+t to do the indentation?
my serial monitor says "not connected. select a board to connect automatically" how can i fix this??
connect a board
Ah Crap, I read that title as using Two Serial ports, since At Mega has two ports. can I shunt the data of one Serial.read() to print that out in the second Serial port and view that in the serial monitor?
It be helpful to he able to see the incoming data, while using it...
i have been watching your workshop it is great i am having a problem when i try to manage my library or upload to my library it keep saying cc.arduino.contribuion.librery please can you help
For some reason my serial monitor doesn't make a new line :( do you know the reason?
Hissenguinho try Serial.println(); instead of Serial.print();
int ledPin = 3;
int buttonPin = 2;
int potPin = A0;
void setup() {
// setup pin modes
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT_PULLUP);
pinMode(potPin, INPUT);
// initialise serial port with baud rate of 9600
Serial.begin(9600);
}
void loop() {
// read the state of buttonPin and store it as buttonState (0 or 1)
int buttonState = digitalRead(buttonPin);
// read the value of the pot, divide it by 4, and store it as potValue
int potValue = analogRead(potPin);
int filteredPotValue = potValue / 4;
// turn led on with the value of potValue
analogWrite(ledPin,filteredPotValue);
// print the value of the button
Serial.print("Button: ");
Serial.print(buttonState);
Serial.print(" ");
// print the value of the pot
Serial.print("Pot: ");
Serial.print(potValue);
Serial.print(" ");
// print the value of the pot / 4 with a line return at the end
Serial.print("Pot/4: ");
Serial.println(filteredPotValue);
}