Pages: 1 ... 7 8 [9] 10
 81 
 on: Today at 04:23:14 pm 
Started by alehandro - Last post by wwbrown
I like the idea of LDRs for tracking the sun. It is wonderfully simple.

I find calculating the positions of the sun easier and less prone to error, the math is not that scary.

 82 
 on: Today at 04:23:05 pm 
Started by jimallen60 - Last post by LarryD
Do you know how to  call a function?

 83 
 on: Today at 04:22:22 pm 
Started by josephchrzempiec - Last post by josephchrzempiec
A gives signal i guess which led it is  1 2 3 or 4  and 0 turns off the led 1 turns on the led so i send a text message to the gsm shield with the sms message of a1 together and that turns on the led i think  that's how it goes. don't fully know how gsm led controls work.

 84 
 on: Today at 04:21:51 pm 
Started by jicho - Last post by jicho
Just saw that OS X installs JAVA RE 7 and that the Arduino software wants to have JAVA SE. So to be sure I've installed the latest version of Java SE (jdk-8u5-macosx-x64.dmg), found here:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Still got the same message when starting the software (version 1.5.6)

Also found this one:
https://github.com/arduino/Arduino/issues/1665

But that's way over my head... The git page references to:
http://stackoverflow.com/questions/14806709/application-is-using-java-6-from-apple-instead-of-java-7-from-oracle-on-mac-os-x

Where you find something about the JVMVersion (http://stackoverflow.com/a/14806841), I've changed this to version 1.6+ and 1.7+ in info.plist, but no success smiley-sad

 85 
 on: Today at 04:21:33 pm 
Started by T-57 - Last post by T-57
Now I have this code:
It says that I need a curly brace but which one.
Otherwise, what is your opinion? What would you suggest? Anything at all.


Code:
#include <Servo.h>

//int motorPinA = 10;
int ledPin = 3;
int repetitions = 0;
int iterations = 0;
//int motorPinB = 5;
//int motorPinC = 8;




//int servoA;
//int servoB;
//int servoC;

Servo servoA;
Servo servoB;
Servo servoC;


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



 
//Servo myservo;  // create servo object to control a servo
                // a maximum of eight servo objects can be created
 
int servoPosA = 0;    // variable to store the servo position, all sevo positions start at zero, as they should.
int servoPosB = 0;
int servoPosC = 0;
 













void setup()
{
  int ledPin;
  //int motorPin;
  //pinMode (motorPinA, OUTPUT);
  pinMode(ledPin, OUTPUT);
  int repetitions;
  int iterations;
  int myservo;
 
 
  //int motorPinB;
  //pinMode(motorPinB, OUTPUT);
  servoA.attach(5);  // attaches the servo (A) on pin 5 to the servo object
  servoB.attach(8);  // a servo (B) is attached to pin 8
  servoC.attach(9);  // a servo (C) is attached to pin 9
}












void loop()
{
 if(iterations >= 2)
 {
      //analogWrite(motorPinA, LOW);
      analogWrite(ledPin, 0);
      //Servo A needs to go to zero, 0, closed, and stay there when   
 }
else
{
  for(int repetitions=0;repetitions<2;repetitions++)
  {
    delay(2000);
    analogWrite(ledPin, 1000);
    delay(2000);
    //Servo A needs to go to 90 degrees, open
   
   
   
   
          for(servoPosA = 0; servoPosA < 90; servoPosA += 1)  // goes from 0 degrees to 180 degrees
       {                                  // in steps of 1 degree
         servoA.write(servoPosA);              // tell servo to go to position in variable 'pos'
         delay(15);                       // waits 15ms for the servo to reach the position
       }
       for(servoPosA = 90; servoPosA>=1; servoPosA-=1)     // goes from 180 degrees to 0 degrees
       {                               
         servoA.write(servoPosA);              // tell servo to go to position in variable 'pos'
         delay(15);
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
    //analogWrite(motorPinA, 70);
    delay (3000);
   
    analogWrite(ledPin, 0);
    //servo A needs to be at 0, closed
   
   
   
   
   
   
   
    //analogWrite(motorPinA, LOW);
    iterations++;           // # value of iterations is counted up by one.
   
   
    if(iterations % 2 ==1) // this will devide iteraions by two and every time there is a remainder of one (AKA each time there is an odd number, AKA every other iteration, an (#.5 number) because that remainder 1 gets divided by two to make a .5*2 = 1, AKA once per day!)
                          // This means that we can give her the twice-a-day-pills and then give her the once a day pills! We just need to adjust the timeing to match a 24-hour day!
   {
    delay(10); //debounce the system
    //make servos B and C run for once a day
   
   
   
   
   
   
   
   
    //analogWrite(motorPinB, 80);
    //delay(300);               Motor A and Motor B may have a need for different speeds, depending on the size and shape of each of the various pills we dispense. Use this code if this is necessary
    //analogWrite(motorPinC, 80);
    delay(300); //how long the motors need to run to spit out exactly one pill of each
   }
  else
  {
delay(10); //debounce the system

// leave servos B and C stay off on the even(second) run of servo A, meaning that A gives twice a day while B and C give once a day.









//analogWrite(motorPinB, LOW); //this is a pill that is given only once a day, motor left off
//analogWrite(motorPinC, LOW); //this is a pill that is given only once a day, motor left off
  }
  }
 }
}


 86 
 on: Today at 04:20:22 pm 
Started by Delta_G - Last post by lar3ry
Once you've left the loop, why would you care what the i and j values are ? Are you planning to jump back into the middle of the loop after leaving for lunch ?
They will be preserved if they are declared outside the for loop, for as long as they are still in scope.  You did notice that the loop counters are declared before the loop is entered, right? There are gazillions of reasons you might want to know the values of loop counters after the loop exits.

 87 
 on: Today at 04:18:24 pm 
Started by jimallen60 - Last post by jimallen60
Ok,

I'm lost!  I did not see any changes, but I figured that I was missing some syntax or something….

As I said, I'm new to this and ready to pull some of the gray hairs I have left….

 88 
 on: Today at 04:17:58 pm 
Started by T-57 - Last post by T-57
Ok

 89 
 on: Today at 04:17:53 pm 
Started by josephchrzempiec - Last post by AWOL
Quote
if pressed a1 led one turn on in sms
Translation, please.

 90 
 on: Today at 04:16:58 pm 
Started by spmvoss - Last post by Msquare
What does your setup code do? How is the circuit handling the inputs before setup has correctly configured pins? Does all this different powersupply include if the Arduino USB is connected or not? (this makes the timing for powerup change as the bootloader does some probing) How do you power the circuits (not the Arduino)?

And last but not at least : is this a real problem? Rephrasing: what would be wrong in supressing any sensor input for a short while (f.ex. the first round of the loop() ?) Having written that, I want to contradict myself by pointing out, that finding the root cause of any "suspicious" behaviour in a program or system is good. Ignoring or supressing it hides some other error, that may be worse.

Pages: 1 ... 7 8 [9] 10