Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Arduino #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Program Android.apk
Binary file not shown.
Binary file added Program AppInventor.aia
Binary file not shown.
37 changes: 37 additions & 0 deletions Program Arduino.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
This sketch is part of a tutorial for connecting to and communicating with an HC-06 or an RN-42 bluetooth module using a custom Android App.
The bluetooth modules are connected to an Arduino and the Arduino is connected to an LED. The Android app is used to wirelessly turn on and
off the LED using bluetooth.

This code is in the public domain.
*/

int led = LED_BUILTIN;

// the setup routine runs once when you press reset:
void setup() {

Serial.begin(9600);
pinMode(led, OUTPUT);
digitalWrite(led, LOW);
}

// the loop routine runs over and over again forever:
void loop() {
delay(30);
String t;
while(Serial.available()) {
t += (char)Serial.read();
}

if(t.length()) {
if(t == "on") {
digitalWrite(led, HIGH);
Serial.write("LED menyala");
}
else if (t == "off") {
digitalWrite(led, LOW);
Serial.write("LED mati");
}
}
}
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
16516243 � Rakha Patria Indrasepta Putra
16516320 � Sarah Az Zahra
16516351 � Arthur Jogy Maratur Siburian