EASY-HOW-TO Hello World in Arduino IDE Tutorial

preview_player
Показать описание
In this video tutorial, you will learn how to:
1. Create the Hello World Arduino sketch version using Arduino IDE
2. Save an Arduino sketch in a folder
3. Compile/verify and upload an Arduino sketch
4. Properly configure the Arduino board and Port to be used
5. Use Serial Monitor
6. Avoid syntax errors in an Arduino sketch
Рекомендации по теме
Комментарии
Автор

Ma'am good day po Wala po kaung circuit totorial ng hello world po salamat po keep safe po

kkhentech
Автор

#include <LiquidCrystal_I2C.h>;
LiquidCrystal_I2C lcd(0x27, 16, 2);
int analogX;
#include <Servo.h> // add servo library

Servo myservo; // create servo object to control a servo

int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin


void setup(){
lcd.init();
pinMode(A0, INPUT);
pinMode(3, OUTPUT);
lcd.backlight();
myservo.attach(2); // attaches the servo on pin 9 to the servo object
}

void loop(){

lcd.setCursor(1, 0);
lcd.print("Hello, world");

lcd.setCursor(1, 1);

analogX = analogRead(A0);

lcd.print(analogX);
lcd.print(" ");
analogWrite(3, analogX);
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 90); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there
}

kasiditruangrit