Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
B.Nagasuman
aurdino
Commits
2e7cbee8
Commit
2e7cbee8
authored
Jun 01, 2019
by
B.Nagasuman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parents
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
113 additions
and
0 deletions
+113
-0
AURDINO CODE
AURDINO CODE
+113
-0
No files found.
AURDINO CODE
0 → 100644
View file @
2e7cbee8
int ledPin = 13;
String readString;
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
Serial.println("serial on/off test 0021"); // so I can keep track
}
void loop() {
while (Serial.available()) {
delay(3);
char c = Serial.read();
readString += c;
}
if (readString.length() >0) {
Serial.println(readString);
if (readString == "on")
{
digitalWrite(ledPin, HIGH);
}
if (readString == "off")
{
digitalWrite(ledPin, LOW);
}
readString="";
}
}char incomingByte;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(D0,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial.available()>0){
incomingByte=Serial.read();
if(incomingByte=='1')
{
digitalWrite(D0,HIGH);
}
else if(incomingByte=='0'){
digitalWrite(D0,LOW);
}
//say what you got:
Serial.print("I received:");
Serial.println(incomingByte,DEC);
delay(10);
}void setup() {
// initialize digital pin 16 as an output.
pinMode(16, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(16, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(16, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for 1/10 secon
}}
PROGRAM D
char IncomingByte;
//int serial;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial.available()>0)
{
IncomingByte=Serial.read();
Serial.print("I HAVE RECEIVED");
Serial.println(IncomingByte,DEC);
delay(10);}
}
PROGRAM E
char incomingByte;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(D0,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial.available()>0){
incomingByte=Serial.read();
if(incomingByte=='1')
{
digitalWrite(D0,HIGH);
}
else if(incomingByte=='0'){
digitalWrite(D0,LOW);
}
//say what you got:
Serial.print("I received:");
Serial.println(incomingByte,DEC);
delay(10);
}
}
PROGRAM B
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment