Show Posts
Pages: 1 ... 5 6 [7] 8 9 ... 13
91  Using Arduino / Programming Questions / Re: Save data in program ROM automatically on: November 30, 2012, 12:08:42 am
Quote
That is the case how to save IR pulse data in EEPROM?
IR pulse represent with on off intergers. One button of remote controller may consist of 100 intergers.
The question is how save those data inEEPROM in compact form.
I know how to save interger in EEPROM but do not know how to compress data and store.

IR pulses hmmm.

Actually you need to decode them first to store. If you read about the protocol of remote controller you will find a way to store them

This will help you lot smiley-cool
http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
92  Using Arduino / Programming Questions / Re: A simple question I am sure on: November 29, 2012, 12:29:32 am
Quote
I am a humble chemist after all

Quote
I'm just a poor science teacher, please don't just tell me I'm wrong and not tell me a solution

Quote
Now you're just being mean.

I don't understand your advice in reply 9.

I don't understand what to call the variables, how to summon them and get them to do anything, is it something to do with sacrificing chickens?


Quote
'm sorry.

I spent several hours, that feel like days, banging my head.

I think I have found a route, but it seems different from what you suggested.


It's mean your are looking here for some one who will serve you meal(code)smiley-cool.
93  Using Arduino / Programming Questions / Re: How to use Timer to exit LoopA,then run LoopB? on: November 29, 2012, 12:03:54 am
PaulS says:
Quote
@Cybernetician
What is going to happen after the Arduino has been running for 10 seconds in your code?
Aqualize Says:
Quote
Yes that one only works the first iteration. I haven't compiled this code to test (to the Arduino C++ variant have do...while... loops?).

Code:
long quitTime;
void loop () {
    quitTime = millis () + 10000;
    do {
        // Do stuff
    } while (millis () < quitTime);

    quitTime = millis () + 2000;
    do {
        // Do other stuff
    } while (millis() < quitTime);
}
Remember that it won't interrupt the execution and jump out of a loop, so to make it work you can't have too much code (execution time wise "much") in there.
Say that in the second step you have code which takes 1.5 second to run. Then it will exit the loop 3 seconds after it started.
But if you have code that only takes 10 ms to run, well you may overshoot with a few ms but that is probably okay.

Quote

Quote
@Cybernetician
What is going to happen after the Arduino has been running for 10 seconds in your code?

Code:
void loop(){
while (millis() < 10000) {
LoopA();
}
while (millis() < 2000) {
LoopB();
}
}

Ooops. what a big mistake

tomorrow i post right one now i am late

thanks PaulS.

Need to minus time of loopA, loopB, and other statements execution time for near to perfect result.

Code:
#include "Timer.h"

Timer t;

bool lpA = true;
bool lpB = false;
int loopAEvent;
int loopBEvent;

void setup()
{
  Serial.begin(9600);
  loopAEvent = t.every(10000, loopBFlag);
}

void loop()
{
  t.update();
  if(lpA==true)
  {
    Serial.println("LOOPA");
  }
  if(lpB==true)
  {
    Serial.println("LOOPB");
  }
}

void loopBFlag()
{
  t.stop(loopAEvent);
  lpA=false;
  lpB=true;
  loopBEvent = t.every(2000, loopAFlag);
}
void loopAFlag()
{
  t.stop(loopBEvent);
  lpA=true;
  lpB=false;
  loopAEvent = t.every(10000, loopBFlag);
}
94  Using Arduino / Programming Questions / Re: How to use Timer to exit LoopA,then run LoopB? on: November 28, 2012, 06:58:09 am
Quote
@Cybernetician
What is going to happen after the Arduino has been running for 10 seconds in your code?

Code:
void loop(){
while (millis() < 10000) {
LoopA();
}
while (millis() < 2000) {
LoopB();
}
}

Ooops. what a big mistake

tomorrow i post right one now i am late

95  Using Arduino / Programming Questions / Re: max size of "long" array? on: November 28, 2012, 01:30:04 am
Quote
Is it feasible to create arrays in Flash memory and store values received from serial to flash?
http://arduino.cc/en/Reference/PROGMEM

Flash (PROGMEM) memory can only be populated at program burn time. You can’t change the values in the flash after the program has started running.(REF: arduino.cc)
96  Using Arduino / Programming Questions / Re: help please Interface rfid with arduino with local page [php] on: November 28, 2012, 01:13:37 am
Quote
good day every one... i need help please.. im currently working in a project using openbiblio. an integrated library system, we want to replace the barcode with rfid reader,.but i dont know how to replace or interface rfid with local web page, someone said that use the arduino.. please some any examples, suggestion or tutorial would be a great help.. thanks, have a good day everyone...

https://github.com/ovidiucp/TinyWebServer
https://www.teleduino.org/
http://starter-kit.nettigo.eu/2011/

May be helpyou lot
97  Using Arduino / Programming Questions / Re: max size of "long" array? on: November 28, 2012, 01:11:20 am
Quote
Is there a more efficient method that I could use to store 2000+ time values?

Efficient method depends on your application what you want to do with those values.
EEPROM and SD card is way to store values
98  Using Arduino / Programming Questions / Re: IR Sensors Read, Compare, and Output Code? on: November 27, 2012, 11:57:11 pm
First i haven't experience of something like that but i try my best to help you.


Quote
The issues we are having is that the output is constantly being turned on and it should only be on if any of the two front wheels are spinning less than the rear. In other words, if the input from FRS is a higher average than FLS, the pin should be on.


Lets start troubleshooting post the values of

Quote
ReadFRS
ReadFLS
ReadRS
FrontAverage
.
.
.

by using Serial.

Code:
Serial.prinln(ReadFRS);
Serial.prinln(ReadFLS);
Serial.prinln(ReadRS);
Serial.prinln(FrontAverage);
Serial.prinln(FrontCompare);
Serial.prinln(TotalCompare);
99  Using Arduino / Programming Questions / Re: Help with Sketch on: November 27, 2012, 11:36:28 pm
Quote
Man I cant believe how many people are on this site so late at night.

All of them are not from same place. smiley-cool
100  Using Arduino / Programming Questions / Re: how to create original interrupts [ ISR() ] on: November 27, 2012, 11:34:32 pm
what i understand first you need to understand about interrupts may it will solve your problem without changes in interrupt.h

this will help you http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=89843&start=all&postdays=0&postorder=asc
101  Using Arduino / Programming Questions / Re: Help with Sketch on: November 27, 2012, 11:28:30 pm
Code:
if (val >= 1 && val <= 100)
  digitalWrite(aPin, HIGH);
  digitalWrite(bPin, HIGH);
  digitalWrite(cPin, HIGH);
  digitalWrite(dPin, HIGH);
  digitalWrite(ePin, HIGH);
  digitalWrite(fPin, HIGH);
  digitalWrite(gPin, LOW);

again wrong attemp first read comments and apply them. smiley-cool
102  Using Arduino / Programming Questions / Re: IR Sensors Read, Compare, and Output Code? on: November 27, 2012, 11:26:11 pm
Quote
...
Now, I know my code probably has plenty of flaws and I am totally open to suggestions and I should probably be using some sort of frequency reading and comparing but I do not know how to use PulseIn() properly or any other frequency detection code. Again, this is my first time using this.

Our final submission is tomorrow so I do not have a lot of time and this is my last resort before saying "screw it".

will you explain what hurdle you facing and Is it not working?
103  Using Arduino / Programming Questions / Re: Help with Sketch on: November 27, 2012, 11:23:53 pm
Code:
if (val >= 1 && val <= 100);
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, LOW);
  digitalWrite(ePin, LOW);
  digitalWrite(fPin, LOW);
  }
  {


If you want to do action on val >= 1 && val <= 100

Code:
if (val >= 1 && val <= 100)
{
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, LOW);
  digitalWrite(ePin, LOW);
  digitalWrite(fPin, LOW);
}
104  Using Arduino / Programming Questions / Re: Help with Sketch on: November 27, 2012, 11:21:46 pm
Code:
if (val >= 1 && val <= 100);
  digitalWrite(aPin, LOW);
  digitalWrite(bPin, LOW);
  digitalWrite(cPin, LOW);
  digitalWrite(dPin, LOW);
  digitalWrite(ePin, LOW);
  digitalWrite(fPin, LOW);
  }
  {

Search for how to use of IF statement
105  Using Arduino / Programming Questions / Re: max size of "long" array? on: November 27, 2012, 11:18:30 pm
Post your code by using # and output of serial

long equal to 4 bytes and it's mean 2000 *4 = 8KB     SRAM   8 KB

this mean your SRAM saturate
Pages: 1 ... 5 6 [7] 8 9 ... 13