Please help us with our school project!

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
sussiesjoqvist
 
Posts: 1
Joined: Wed Mar 23, 2016 1:28 pm

Please help us with our school project!

Post by sussiesjoqvist »

Soo, we have a school project called 'Explore new tech'. For not so tech people...
Task:
We'll make a box of Plexiglas that is linked to an android app. In the app, you can create your own to-do lists. When you checked off the chores listed in the app, the box will open, by means of a lock. In the box, you have already put something you would like to have (a reward).
This can be used by e.g. families - the kids have to clean the room before Saturday to get the candy in the box. When the children checked in the boxes in the list the parents have to approve. Then the box will open and they will get their reward.

Technology we use:
- An Arduino Uno
- 9v battery
- HC06 bluetooth
- Breadboard
- Servo motor "Futaba S3003"
- Android app

Problem:
- The problem is that we want to connect to Bluetooth - the lamp on the bluetooth is flashing but we can't get any communication between the bluetooth and the phone.
- We have obtained the motor to spin, by means of the code bellow. Then we want to have a button for "open" and one for "close" in our android app. So we have got the motor to spin, but we want to control it with open and close buttons. What code shall we use?!

We believe we need to put any "if" or "else" code?!

I might add that we spent almost a week to checking tutorials now!

Is there anyone here who has the skills to help us?
Thanks in advance!

Code: Select all

// Sweep
// by BANNED <http://BANNED.com> 
// This example code is in the public domain.


#include <Servo.h> 
 
Servo myservo;  // create servo object to control a servo 
                // a maximum of eight servo objects can be created 
 
int pos = 0;    // variable to store the servo position 
 
void setup() 
{ 
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
} 
 
 
void loop() 
{ 
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
 
  
  } 
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees 
  {                                
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
}
Last edited by Franklin97355 on Wed Mar 23, 2016 6:50 pm, edited 1 time in total.
Reason: Added missing [code] tags

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”