Life is Short
Eternal Poster
Tanong lang kung anong statement ang gamitin for example magpili ako sa choices A, B, C. Tapos mag input si user kung anong gusto nya sa tatlo.
Sana may pumansin TY.
Sana may pumansin TY.
Ou ganito paps salamat, pano eto i convert sa Arduino platform di kasi ma read sa Arduino IDE.ganyan ba?
Salamat paps try ko paguwi ko ng schoolIf (DigitalRead(0)=='A')
{
}
Else if (DigitalRead(0)=='B')
{
}
And so on
Ipasok mo sa loop para the moment na may mangyari map-pickup kagad ni arduino.
Button ang input ko. Bale may 3 buttons ako Up Down at set buttonSensor ba? Serial?
justkeepcalm paps paki check ang code di ko kasi makuha ang gusto ko mangyari.Tapos yung switch mo naka connect sa ground tapos dun sa pin#
Di kita gets papsIs it difficult to format the code snippets with the code markers? It's hard to read the code snippets in free form.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4);
int setNum;
int P2=2;
int P3=3;
int P1=4;
int P4=5;
int LED=6;
int LED2=7;
int LED3=8;
void setup()
{
lcd.begin();
lcd.backlight();
lcd.clear();
pinMode(P2,INPUT_PULLUP);
pinMode(P3,INPUT_PULLUP);
pinMode(P1,INPUT_PULLUP);
pinMode(P4, INPUT_PULLUP);
pinMode(LED, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
}
void loop() {
while(digitalRead(P1)==HIGH)
{
lcd.clear();
if(digitalRead(P2)==LOW)
{
if (setNum==3)
{
setNum=0;
}
else
{
setNum=setNum+1;
}
}
if(digitalRead(P3)==LOW)
{
if (setNum==0)
{
setNum=3;
}
else
{
setNum=setNum-1;
}
}
if (digitalRead(P4)==HIGH)
{
if (digitalRead((setNum,DEC))=='1')
{
digitalWrite(LED, HIGH);
delay(200);
digitalWrite(LED, LOW);
break;
}
else if (digitalRead((setNum,DEC))=='2')
{
digitalWrite(LED2, HIGH);
delay(200);
digitalWrite(LED2, LOW);
break;
}
else if (digitalRead((setNum,DEC))=='3')
{
digitalWrite(LED3, HIGH);
delay(200);
digitalWrite(LED3, LOW);
break;
}
}
lcd.setCursor(0,0);
lcd.print("Select Number :");
lcd.setCursor(17,0);
lcd.print(setNum,DEC);
lcd.setCursor(0,1);
lcd.print("1.RED LED");
lcd.setCursor(0,2);
lcd.print("2.BLUE LED");
lcd.setCursor(0,3);
lcd.print("3.GREEN LED");
delay(200);
}
delay(200);
}
Walang nangyari after ko pinindot ang ika fourth button (P4). Walang umiilaw na LED. Bale ano ba dapat ang ilagay saAnong issue na? Rather saan part ka na nal-lito?
Okey na paps nakuha ko naAnong issue na? Rather saan part ka na nal-lito?
, salamat sa tipsOkey na paps nakuha ko na, salamat sa tips
ECE bossboss ano course mo ?