Loading...
  Show Posts
Pages: 1 [2] 3 4 ... 1321
16  Using Arduino / Programming Questions / Re: Want to know how long it takes to read the whole EEPROM. on: May 22, 2013, 01:35:43 pm
Quote
The ATmega328 has 1 KiB of EEPROM.
kibibit != kilobit,
17  Using Arduino / Programming Questions / Re: Want to know how long it takes to read the whole EEPROM. on: May 22, 2013, 01:23:57 pm
Quote
the whole 1024 bit EEPROM.
Which processor do you have - none that I know have that small an EEPROM.
18  Using Arduino / Project Guidance / Re: Please help, First project Saw Billy puppet. [mod. edit] on: May 22, 2013, 12:53:33 pm
Please, use the auto format tool before posting
19  Using Arduino / Programming Questions / Re: Combining Sketches on: May 22, 2013, 09:37:06 am
Code:
float temperature = getTemp() * 1.8 + 32;
Maybe you deleted "getTemp" when you combined the sketches.
Try putting it back.
20  Using Arduino / Programming Questions / Re: Help on error codes on: May 22, 2013, 09:33:02 am
Code:
#include <LiquidCrystal.h> // import the library
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);// data and control lines
String adjusts[]={
  "      iDeas"," Adjust seconds"," Adjust minutes","  Adjust hours"};// set text  values for adjust menu
int adjustmode=0; // the track of the adjust menu
int hour=0; // the count of hours upon which we can make the mathematical operations
int minute=0; // the count of minutes upon which we can make the mathematical operations
int second=0;// the count of seconds upon which we can make the mathematical operations
String hourstring="";//the output variable component for hours
String minutestring="";//the output variable component for minutes
String secondstring="";//the output variable component for seconds
long timethen=0;//the variable to hold a sample of the time in seconds
boolean runbutton=false; //the variable to control the run button
boolean alarmon=false;// the switch for the alarm
boolean pause=false;// the track for the pause
void setup(){
  lcd.begin(16,2);//start the LCD module
  lcd.clear();//clear down residual text
  lcd.print(adjusts[0]);//printout start screen
}
void loop(){
  int timezero=hour+minute+second ;
  if (runbutton==false&&adjustmode==0&&digitalRead(6)==HIGH&&timezero>0){
    runbutton=true;
    timethen=millis();
  }//sets condition for running the timer on buttonpress and samples time
  if (runbutton==false&&digitalRead(7)==HIGH&&alarmon==false){//starts loop if not running countdown and adjust button has been pressed
    lcd.setCursor(0,0);
    lcd.print("                ");//clears top line of module
    adjustmode++;
    if(adjustmode==4){
      adjustmode=0;
    }//increment variable and reset at 4
    lcd.setCursor(0,0);
    lcd.print(adjusts[adjustmode]);// set to top line and print out what to adjust
    delay(500);//wait for half a second
  }
  if(runbutton==false&&adjustmode==1&&digitalRead(8)==HIGH){
    second++;
    delay(500);
    if(second==60){
      second=0;
    }
  } //increment seconds by 1
  if(runbutton==false&&adjustmode==1&&digitalRead(9)==HIGH){
    second--;
    delay(500);
    if(second==-1){
      second=59;
    }
  } //decrement seconds by 1
  if(runbutton==false&&adjustmode==2&&digitalRead(8)==HIGH){
    minute++;
    delay(500);
    if(minute==60){
      minute=0;
    }
  } //increment minutes by 1
  if(runbutton==false&&adjustmode==2&&digitalRead(9)==HIGH){
    minute--;
    delay(500);
    if(minute==-1){
      minute=59;
    }
  } //decrement minutes by 1
  if(runbutton==false&&adjustmode==3&&digitalRead(8)==HIGH){
    hour++;
    delay(500);
    if(hour==60){
      hour=0;
    }
  } //increment hours by 1
  if(runbutton==false&&adjustmode==3&&digitalRead(9)==HIGH){
    hour--;
    delay(500);
    if(hour==-1){
      hour=59;
    }
  } //decrement hours by 1
  if (runbutton==true&&pause==false&&digitalRead(7)==HIGH){
    pause=true;
    delay(1000);
    timethen=timethen+1000;
  }//switch pause on
  if (runbutton==true&&pause==true&&digitalRead(7)==HIGH){
    pause=false;
    delay(1000);
    timethen=timethen+1000;
  }//switch pause off
  if (runbutton==true&&digitalRead(8)==HIGH){
    hour=0;
    minute=0;
    second=0;
    runbutton=false;
  }//clears the countdown and resets to zero
  if (pause==true){
    timethen=millis();
  }//track time in pause mode
  if(runbutton==true&&pause==false){// ** all the lines following marked with //** are active only when running
    if (millis()-timethen>=1000){
      timethen=millis();
      second=second-1;
      tone(10,50,10);
    }//**as a second passes drop down seconds and make tick sound
    if (second==-1) {
      second=59;
      minute=minute-1;
    }//**as a minute passes drop down minutes
    if (minute==-1) {
      minute=59;
      hour=hour-1;
    }//**as an hour passes drop down hours
    if(hour==-1){
      hour=0;
    }//**reset hours to 0

  }

  if (runbutton==true&&hour==0&&minute==0&&second==0){
    alarmon=true;
    runbutton=false;
  }// set conditions for end of run(time remaining is zero)
  if (hour<10){
    hourstring="0";
    hourstring=hourstring+hour;
  }
  else {
    hourstring=String(hour);  // <<< I FIXED THIS LINE
  }//setup for hour output
  if (minute<10){
    minutestring="0";
    minutestring=minutestring+minute;
  }
  else {
    minutestring=minute;  // << You can fix this one
  }//setup for minute output
  if (second<10){
    secondstring="0";
    secondstring=secondstring+second;
  }
  else {
    secondstring=second;  // << you can fix this one
  }//setup for second output
  String outstring=hourstring+":"+minutestring+":"+secondstring;//compound string for output
  lcd.setCursor(4,1);
  lcd.print(outstring);//set position and print compound string
  if (alarmon==true){// activates at end of run time
    tone(10,444,10);//outputs tone
    if (digitalRead(6)==HIGH){
      alarmon=false;
      pause=false;
    }
  }//switches off tone when run button is pressed
}
Don't forget to tell us your grade.
21  Using Arduino / Programming Questions / Re: Help on error codes on: May 22, 2013, 09:20:17 am
The fix I gave you (and another similar couple of instances of the same) fixed it for me.
Well, it compiled - beyond that, I'm not interested - I don't have your hardware (actually, I don't even have an Arduino)

What errors are you getting now?
Post your code
22  Using Arduino / Project Guidance / Re: convert a rotational motor to a linear motor. on: May 22, 2013, 09:15:31 am
A crank or a cam?
Lead screw?
23  Using Arduino / Programming Questions / Re: Help on error codes on: May 22, 2013, 09:11:51 am
I don't use String for well-documented reasons (and I'm really old), but does
Code:
  hourstring = String(hour);
help at all?
24  Using Arduino / Programming Questions / Re: Help on error codes on: May 22, 2013, 08:19:59 am
I just assumed s/he was lost in BASIC.   smiley-grin
I posted the code because you hadn't, and I auto-formatted it because the author hadn't.
25  Using Arduino / Project Guidance / MOVED: Looking For Coder/Help on: May 22, 2013, 08:13:38 am
This topic has been moved to Gigs and Collaborations.

http://forum.arduino.cc/index.php?topic=167703.0
26  Using Arduino / Programming Questions / Re: Help on error codes on: May 22, 2013, 08:12:01 am
Auto-format works wonders:
Code:
#include <LiquidCrystal.h> // import the library
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);// data and control lines
String adjusts[]={
  "      iDeas"," Adjust seconds"," Adjust minutes","  Adjust hours"};// set text  values for adjust menu
int adjustmode=0; // the track of the adjust menu
int hour=0; // the count of hours upon which we can make the mathematical operations
int minute=0; // the count of minutes upon which we can make the mathematical operations
int second=0;// the count of seconds upon which we can make the mathematical operations
String hourstring="";//the output variable component for hours
String minutestring="";//the output variable component for minutes
String secondstring="";//the output variable component for seconds
long timethen=0;//the variable to hold a sample of the time in seconds
boolean runbutton=false; //the variable to control the run button
boolean alarmon=false;// the switch for the alarm
boolean pause=false;// the track for the pause
void setup(){
  lcd.begin(16,2);//start the LCD module
  lcd.clear();//clear down residual text
  lcd.print(adjusts[0]);//printout start screen
}
void loop(){
  int timezero=hour+minute+second ;
  if (runbutton==false&&adjustmode==0&&digitalRead(6)==HIGH&&timezero>0){
    runbutton=true;
    timethen=millis();
  }//sets condition for running the timer on buttonpress and samples time
  if (runbutton==false&&digitalRead(7)==HIGH&&alarmon==false){//starts loop if not running countdown and adjust button has been pressed
    lcd.setCursor(0,0);
    lcd.print("                ");//clears top line of module
    adjustmode++;
    if(adjustmode==4){
      adjustmode=0;
    }//increment variable and reset at 4
    lcd.setCursor(0,0);
    lcd.print(adjusts[adjustmode]);// set to top line and print out what to adjust
    delay(500);//wait for half a second
  }
  if(runbutton==false&&adjustmode==1&&digitalRead(8)==HIGH){
    second++;
    delay(500);
    if(second==60){
      second=0;
    }
  } //increment seconds by 1
  if(runbutton==false&&adjustmode==1&&digitalRead(9)==HIGH){
    second--;
    delay(500);
    if(second==-1){
      second=59;
    }
  } //decrement seconds by 1
  if(runbutton==false&&adjustmode==2&&digitalRead(8)==HIGH){
    minute++;
    delay(500);
    if(minute==60){
      minute=0;
    }
  } //increment minutes by 1
  if(runbutton==false&&adjustmode==2&&digitalRead(9)==HIGH){
    minute--;
    delay(500);
    if(minute==-1){
      minute=59;
    }
  } //decrement minutes by 1
  if(runbutton==false&&adjustmode==3&&digitalRead(8)==HIGH){
    hour++;
    delay(500);
    if(hour==60){
      hour=0;
    }
  } //increment hours by 1
  if(runbutton==false&&adjustmode==3&&digitalRead(9)==HIGH){
    hour--;
    delay(500);
    if(hour==-1){
      hour=59;
    }
  } //decrement hours by 1
  if (runbutton==true&&pause==false&&digitalRead(7)==HIGH){
    pause=true;
    delay(1000);
    timethen=timethen+1000;
  }//switch pause on
  if (runbutton==true&&pause==true&&digitalRead(7)==HIGH){
    pause=false;
    delay(1000);
    timethen=timethen+1000;
  }//switch pause off
  if (runbutton==true&&digitalRead(8)==HIGH){
    hour=0;
    minute=0;
    second=0;
    runbutton=false;
  }//clears the countdown and resets to zero
  if (pause==true){
    timethen=millis();
  }//track time in pause mode
  if(runbutton==true&&pause==false){// ** all the lines following marked with //** are active only when running
    if (millis()-timethen>=1000){
      timethen=millis();
      second=second-1;
      tone(10,50,10);
    }//**as a second passes drop down seconds and make tick sound
    if (second==-1) {
      second=59;
      minute=minute-1;
    }//**as a minute passes drop down minutes
    if (minute==-1) {
      minute=59;
      hour=hour-1;
    }//**as an hour passes drop down hours
    if(hour==-1){
      hour=0;
    }//**reset hours to 0

  }

  if (runbutton==true&&hour==0&&minute==0&&second==0){
    alarmon=true;
    runbutton=false;
  }// set conditions for end of run(time remaining is zero)
  if (hour<10){
    hourstring="0";
    hourstring=hourstring+hour;
  }
  else {
    hourstring=hour;
  }//setup for hour output
  if (minute<10){
    minutestring="0";
    minutestring=minutestring+minute;
  }
  else {
    minutestring=minute;
  }//setup for minute output
  if (second<10){
    secondstring="0";
    secondstring=secondstring+second;
  }
  else {
    secondstring=second;
  }//setup for second output
  String outstring=hourstring+":"+minutestring+":"+secondstring;//compound string for output
  lcd.setCursor(4,1);
  lcd.print(outstring);//set position and print compound string
  if (alarmon==true){// activates at end of run time
    tone(10,444,10);//outputs tone
    if (digitalRead(6)==HIGH){
      alarmon=false;
      pause=false;
    }
  }//switches off tone when run button is pressed
}

"Handy REM statements" ?
27  Using Arduino / Programming Questions / Re: Simple question - reversing? on: May 22, 2013, 05:55:28 am
So, what is the sensor value for the brightest light source you have?
28  Using Arduino / Programming Questions / Re: Simple question - reversing? on: May 22, 2013, 05:48:53 am
You can see numbers in your serial monitor.
I can't see those numbers.
29  Using Arduino / Programming Questions / Re: Simple question - reversing? on: May 22, 2013, 05:42:33 am
See reply #7
30  Using Arduino / Programming Questions / Re: Simple question - reversing? on: May 22, 2013, 05:34:58 am
So what is the serial monitor showing?
Pages: 1 [2] 3 4 ... 1321