This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int motor =9; | |
void setup(){ | |
pinMode (9, OUTPUT); | |
} | |
void loop(){ | |
int speed; | |
speed = 255; | |
analogWrite(motor,speed); | |
} |
We also worked on using an IR remote to control the message that appears on the LCD. A video is shown below of the remote changing the message. The code used is also posted below.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <LiquidCrystal.h> | |
#include <IRremote.h> | |
LiquidCrystal lcd(12,11,5,4,3,2); | |
int RECV_PIN = 10; | |
IRrecv irrecv(RECV_PIN); | |
decode_results results; | |
void setup() | |
{ | |
Serial.begin(9600); | |
irrecv.enableIRIn(); | |
lcd.begin(16, 2); | |
lcd.clear(); | |
lcd.print("System Charging"); | |
delay(3000); | |
} | |
void loop () | |
{ | |
if (irrecv.decode(&results)) { | |
Serial.println(results.value); | |
irrecv.resume(); | |
if(results.value == 3785495787) | |
{ | |
lcd.setCursor(0,0); | |
lcd.print("Ramming Speed "); | |
} | |
if(results.value == 3785503947) | |
{ | |
lcd.setCursor(0,0); | |
lcd.print("Battle Speed "); | |
} | |
} | |
} |
No comments:
Post a Comment