Go Down

Topic: Using android mobile to control arduino (Read 136652 times) previous topic - next topic

naurisdzerve

Can someone please help to send information from App inventor Spinner to arduino. I made Spinner 1-9 and now I want this information on arduino.

kalpana

hi,

    Is it possible to have android accessory on ATSAMD21 similar to that of AVR32848.
If so how can this be implemented.

janjust99

Hello, could you pls uploaded apk file.
This link is not working http://speedy.sh/63Q9N/bluetoothforarduino-app-2.apk
Thanks
Jan

Arne_

Hi , I'm trying to combine the temperature appication and the slide application (with the LEDs) to one application. when I am trying to connect the application it freezes, appart the two applications work but to merge it I still have some problems. the Arduino program that I currently have.


#include <OneWire.h>

int DS18S20_Pin = 2;

//temperatuur chip in/ out
OneWire ds(DS18S20_Pin);
const int greenPin = 9;
const int bluePin =11; 
const int redPin2 = 10;
byte serialA;

void setup() {

Serial.begin(9600);



pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
pinMode(redPin2, OUTPUT);




}

void loop() { // word steets herhaalt


if (serialA == 49){float temperature = getTemp();
serialA = 0;

}
// als er serial data is, lees dit
while (Serial.available() > 0) {


 int green = Serial.parseInt();

 int blue = Serial.parseInt();

 int red2 = Serial.parseInt();

 if (Serial.read() == '\n') {       

   green = constrain(green, 0, 255);
   blue = constrain(blue, 0, 255);
   red2 = constrain(red2, 0, 255);

   analogWrite(greenPin, green);
   analogWrite(bluePin, blue);
   analogWrite(redPin2, red2); 
 }
}

}

float getTemp(){

byte data[12];
byte addr[8];
if ( !ds.search(addr)) {

ds.reset_search();
return -100;
}
if ( OneWire::crc8( addr, 7) != addr[7]) {
return -1000;

}
if ( addr[0] != 0x10 && addr[0] != 0x28) {
return -1000;

}
ds.reset();
ds.select(addr);
ds.write(0x44,1);
byte present = ds.reset();
ds.select(addr);
ds.write(0xBE);
for (int i = 0; i < 9; i++) {
data = ds.read();
}
ds.reset_search();
byte MSB = data[1];
byte LSB = data[0];
float tempRead = ((MSB << 8) | LSB);
float TemperatureSum = tempRead / 16;
return TemperatureSum;}
void serialEvent()
{
serialA = Serial.read();
}



thanks for helping

Hanadi

Hay Guys anyone can help here i need an arduino code with 4 DC  cuz only the 2DC is working with me
with bluetooth module

- i dunno how to change the com if i want the car to be controlled by andriod mobile

- the car wheels only moves while am holding it up from the ground only i dunno what is the reason

HELPP Please ! Thanks in advance.

Sushma_S

hi kerimil
thank you for sharing ur work with us.
please helpme.

am doing project on arduino. my project is controlling the lighting systems, where i have to control the LED blinking ON/Off , dimming LED's .

am using below code to dimming the LED's

// Output
int redPin   = 9;   // Red LED,   connected to digital pin 9
int greenPin = 10;  // Green LED, connected to digital pin 10
int bluePin  = 11;  // Blue LED,  connected to digital pin 11

// Program variables
int redVal   = 255; // Variables to store the values to send to the pins
int greenVal = 1;   // Initial values are Red full, Green and Blue off
int blueVal  = 1;

int i = 0;     // Loop counter   
int wait = 50; // 50ms (.05 second) delay; shorten for faster fades
int DEBUG = 0; // DEBUG counter; if set to 1, will write values back via serial

void setup()
{
  pinMode(redPin,   OUTPUT);   // sets the pins as output
  pinMode(greenPin, OUTPUT);   
  pinMode(bluePin,  OUTPUT);
  if (DEBUG) {           // If we want to see the pin values for debugging...
    Serial.begin(9600);  // ...set up the serial ouput on 0004 style
  }
}

// Main program
void loop()
{
  i += 1;      // Increment counter
  if (i < 255) // First phase of fades
  {
    redVal   -= 1; // Red down
    greenVal += 1; // Green up
    blueVal   = 1; // Blue low
  }
  else if (i < 509) // Second phase of fades
  {
    redVal    = 1; // Red low
    greenVal -= 1; // Green down
    blueVal  += 1; // Blue up
  }
  else if (i < 763) // Third phase of fades
  {
    redVal  += 1; // Red up
    greenVal = 1; // Green low
    blueVal -= 1; // Blue down
  }
  else // Re-set the counter, and start the fades again
  {
    i = 1;
  } 

  analogWrite(redPin,   redVal);   // Write current values to LED pins
  analogWrite(greenPin, greenVal);
  analogWrite(bluePin,  blueVal); 

  if (DEBUG) { // If we want to read the output
    DEBUG += 1;     // Increment the DEBUG counter
    if (DEBUG > 10) // Print every 10 loops
    {
      DEBUG = 1;     // Reset the counter

      Serial.print(i);       // Serial commands in 0004 style
      Serial.print("\t");    // Print a tab
      Serial.print("R:");    // Indicate that output is red value
      Serial.print(redVal);  // Print red value
      Serial.print("\t");    // Print a tab
      Serial.print("G:");    // Repeat for green and blue...
      Serial.print(greenVal);
      Serial.print("\t");   
      Serial.print("B:");   
      Serial.println(blueVal); // println, to end with a carriage return
    }
  }
  delay(wait); // Pause for 'wait' milliseconds before resuming the loop
}




In my project am using arduino uno with bluetooth HC-05./bluetooth+HC+05‎

i want to control this arduino with my android phone.i want to send commands from my phone to arduino through the bluetooth to controll this dimming of LED's.

for this control am using the android mobile app is andudroid.https://play.google.com/store/apps/details?id=com.techbitar.android.

i want to write a code for controlling arduino by android. so what can i add to my code to response with my android commands.
can u please send me a  source code to do this operation. its very helpfull for me.
Am waiting for ur reply.


thank u


Sushma_S

hi kerimil
thank you for sharing ur work with us.
please helpme.

am doing project on arduino. my project is controlling the lighting systems, where i have to control the LED blinking ON/Off , dimming LED's .

am using below code to dimming the LED's

// Output
int redPin   = 9;   // Red LED,   connected to digital pin 9
int greenPin = 10;  // Green LED, connected to digital pin 10
int bluePin  = 11;  // Blue LED,  connected to digital pin 11

// Program variables
int redVal   = 255; // Variables to store the values to send to the pins
int greenVal = 1;   // Initial values are Red full, Green and Blue off
int blueVal  = 1;

int i = 0;     // Loop counter   
int wait = 50; // 50ms (.05 second) delay; shorten for faster fades
int DEBUG = 0; // DEBUG counter; if set to 1, will write values back via serial

void setup()
{
  pinMode(redPin,   OUTPUT);   // sets the pins as output
  pinMode(greenPin, OUTPUT);   
  pinMode(bluePin,  OUTPUT);
  if (DEBUG) {           // If we want to see the pin values for debugging...
    Serial.begin(9600);  // ...set up the serial ouput on 0004 style
  }
}

// Main program
void loop()
{
  i += 1;      // Increment counter
  if (i < 255) // First phase of fades
  {
    redVal   -= 1; // Red down
    greenVal += 1; // Green up
    blueVal   = 1; // Blue low
  }
  else if (i < 509) // Second phase of fades
  {
    redVal    = 1; // Red low
    greenVal -= 1; // Green down
    blueVal  += 1; // Blue up
  }
  else if (i < 763) // Third phase of fades
  {
    redVal  += 1; // Red up
    greenVal = 1; // Green low
    blueVal -= 1; // Blue down
  }
  else // Re-set the counter, and start the fades again
  {
    i = 1;
  }

  analogWrite(redPin,   redVal);   // Write current values to LED pins
  analogWrite(greenPin, greenVal);
  analogWrite(bluePin,  blueVal);

  if (DEBUG) { // If we want to read the output
    DEBUG += 1;     // Increment the DEBUG counter
    if (DEBUG > 10) // Print every 10 loops
    {
      DEBUG = 1;     // Reset the counter

      Serial.print(i);       // Serial commands in 0004 style
      Serial.print("\t");    // Print a tab
      Serial.print("R:");    // Indicate that output is red value
      Serial.print(redVal);  // Print red value
      Serial.print("\t");    // Print a tab
      Serial.print("G:");    // Repeat for green and blue...
      Serial.print(greenVal);
      Serial.print("\t");   
      Serial.print("B:");   
      Serial.println(blueVal); // println, to end with a carriage return
    }
  }
  delay(wait); // Pause for 'wait' milliseconds before resuming the loop
}




In my project am using arduino uno with bluetooth HC-05./bluetooth+HC+05‎

i want to control this arduino with my android phone.i want to send commands from my phone to arduino through the bluetooth to controll this dimming of LED's.

for this control am using the android mobile app is andudroid.https://play.google.com/store/apps/details?id=com.techbitar.android.

i want to write a code for controlling arduino by android. so what can i add to my code to response with my android commands.
can u please send me a  source code to do this operation. its very helpfull for me.
Am waiting for ur reply.


thank u

broxcode

Hi,


You can find here a very recent application with new openings about how to control your board from your mobile  : https://play.google.com/store/apps/details?id=com.errafay.arduinobluecontrol , i hope you enjoy it ;) !

Go Up