Show Posts
Pages: 1 ... 4 5 [6] 7
76  Using Arduino / Project Guidance / Connections for bootloading a nano based board on: April 18, 2012, 10:26:40 am
I am laying out a pcb based on a Arduino Nano, so it has SMT Atmega328 and the FT323RL. I am a little confused as to what connections I need for bootloading the chips as they will be blank obviously.
Can they be bootloaded through the USB port or do I Have to have access to MOSI, MISO and SCK just for bootloading?
77  Community / Gigs and Collaborations / looking for a PC interface for my simple project on: March 13, 2012, 12:48:40 pm
I am lookingfor an estimate for someone to write  simple PC interfce for my project.
I am using a standalone board and will have to add wifi or USB port to transfer data to PC.
Basically the program should allow a JPG file to be uploaded and then store values read from a sensor on arduino at locations clicked on the JPG. This could be a picture of a machine, the user will click an area on the jpg and the program should insert the current value from the sensor at that location. There may be 20 - 50 locations. The usual font color choices and text size options should be available.
Its very simple but someone who understands arduino comms should do it fine.
Let me know if youre interested and a rough price.
 
78  Using Arduino / Programming Questions / Re: Sampling analogRead() highs and lows. on: March 03, 2012, 11:05:17 am
Ah now that is a good way, thank you. I was thinking of Min Max but was stuck with having to have 2 numbers. Reversing the maximun and minimum possible is a great idea.
Sorry for not being clear about the print and delay, those were only there for testing so that I can see the function is working, they will be removed after.

Thank you Rob
79  Using Arduino / Programming Questions / Re: help understanding multiMap function on: March 03, 2012, 01:43:44 am
Thank you very much. Appreciate your time.
80  Using Arduino / Programming Questions / Re: Sampling analogRead() highs and lows. on: March 03, 2012, 01:38:03 am
Yes it only needs to work once at startup
I can remove the delay but 5 samles over 5 seconds is enough.
It seems to store the low value ok but the high value doesnt hold. After 10 seconds it shows 1 correct reading and then drops to an arbitrary low value
81  Using Arduino / Programming Questions / Sampling analogRead() highs and lows. on: March 03, 2012, 01:08:01 am
I have a need to record the high and low points of a sensor during the first 10 seconds.
from startup to 5 seconds the sensor will be driven low and from 5 to 10 seconds it will be driven high.
I want to return these 2 values.
i tried the following code but it doesnt seem to work. Am I doing something wrong? probably....
Code:
while (millis() < 5000) {
    sampleLow = analogRead(0);
    // wait a second so as not to send massive amounts of data
  delay(1000);
 Serial.print(sampleLow);
  Serial.println("  ");

 }

while (millis() < 10000) {
 
 sampleHigh = analogRead(0);
       // wait a second so as not to send massive amounts of data
  delay(1000);
 
 
    Serial.print(sampleHigh);
  Serial.println("  ");
 
}
82  Using Arduino / Programming Questions / Re: help understanding multiMap function on: March 02, 2012, 05:16:44 pm
Helps a lot, thank you.
I have never come accross the uint_t size parameter before..

What does this mean? I have searched but am not clear on the meaning.
83  Using Arduino / Programming Questions / Re: help understanding multiMap function on: March 01, 2012, 09:59:47 pm
As an add to above, here is my code but I get a compilation error "undefined reference to multiMap(int, int*, int*, unsigned char)


Code:
int multiMap(int rawMM, int* _mils, int* _anlogin, uint8_t size);

 
 
  rawMM = analogRead(0); 
 
  int mils[] = { 1,25,50,75,100,125,150,175,200,225,250,300,350,400,475,550,600}; //output required
 
  int anlogin[] = { 338,381,420,456,492,518,544,571,592,614,640,670,696,719,743,765,779 }; //sampled anlogread
 
 

 
int mm = multiMap(rawMM, anlogin, mils, 17);
84  Using Arduino / Programming Questions / help understanding multiMap function on: March 01, 2012, 09:37:51 pm
I need assistane understanding the multiMap() function found in the playground.

I also have 2 arrays, one is a series of known analogRead points and the second is a list of corresponding output results that I want with interpolation between.

I do not understand the structure and meaning of the multiMap() declaration statement in line 1. Can someone please break down what each of the 4 items are?
thanks
The post is at http://arduino.cc/playground/Main/MultiMap


Code:
The code:

int multiMap(int val, int* _in, int* _out, uint8_t size)
{
  // take care the value is within range
  // val = constrain(val, _in[0], _in[size-1]);
  if (val <= _in[0]) return _out[0];
  if (val >= _in[size-1]) return _out[size-1];

  // search right interval
  uint8_t pos = 1;  // _in[0] allready tested
  while(val > _in[pos]) pos++;

  // this will handle all exact "points" in the _in array
  if (val == _in[pos]) return _out[pos];

  // interpolate in the right segment for the rest
  return map(val, _in[pos-1], _in[pos], _out[pos-1], _out[pos]);
}

Usage
Some snippets shows how multiMap() can be used:


  //My calibrated distance sensor - SHARP 2Y0A02 F 9Y
  // out[] holds the values wanted in cm
  int out[] = {150,140,130,120,110,100, 90, 80, 70, 60, 50, 40, 30, 20};
  // in[] holds the measured analogRead() values for defined distances
  int in[]  = { 90, 97,105,113,124,134,147,164,185,218,255,317,408,506};
  val = analogRead(A0);
  cm = multiMap(val, in, out, 14);



85  Using Arduino / Programming Questions / Re: Unused Analog Inputs Atmega328 - question on: February 28, 2012, 06:10:01 pm
Wow, that is a great article, thank you.
I am using my own board in my device si it has no USB,
86  Using Arduino / Programming Questions / Re: Unused Analog Inputs Atmega328 - question on: February 28, 2012, 05:51:43 pm
Thank you Nick, So following what you said, I shouldnt add anything to the current draw either? The device is battery operated.
87  Using Arduino / Programming Questions / Unused Analog Inputs Atmega328 - question on: February 28, 2012, 05:39:39 pm
If I am deploying a stand alone projevt and only use 1 of the analog inputs, does it provide any benefit to enable the pull up resistors on the unused pins?
I am thinking of stability more than  anything else.
88  Using Arduino / Programming Questions / Re: Two loops or branches help needed on: February 26, 2012, 09:36:24 pm
There is actually more code during the millis time, an If statement makes a decision for the rest of the program.
Yes the first delay 91000) is to let the sensor settle.
Thanks
89  Using Arduino / Programming Questions / Re: Two loops or branches help needed on: February 26, 2012, 05:02:04 pm
Nevermind
I just saw my own stupidity.
I swapped <and>
Duhh

90  Using Arduino / Programming Questions / Re: Two loops or branches help needed on: February 26, 2012, 04:58:08 pm
Thanks, but it seems to behave the same, it reaches the fuctions but does not execute any IF or WHILE statements in that function AND it does not stay in the loop, it goes back again to void loop()

In the following code, I test to see if the function call works but it does not execute the WHILE line.
It should print
 650    (sensorValue) once only
reachedbig
big
big
big    etc

instead it outputs

650
reached big
650
reached big
650
reached big
etc

Code:
int sensorValue = 0;


void setup()
{
  // setup serial - diagnostics - port
  Serial.begin(9600);
 
   analogReference(INTERNAL);

 
}
 

void loop()
{
 
 
   while (millis() < 5000) {
    delay(1000);
   sensorValue = analogRead(1);}
   
   Serial.println(analogRead(1));
     
   
   if (sensorValue < 450){
       small();
      } 
     
  else {
       big();
      }
}
 
void big() 
{
    Serial.println("reached big"); // check to see if program reached this point
    while (sensorValue < 450)
   {
     
     Serial.println("big");}//if program reaches this point it should print "big"
     
 }
 
void small()

{
    Serial.println("reached small"); // check to see if program reached this point
   
    while (sensorValue > 450) //if program reaches this point it should print "small"
  {
 
    Serial.println("small");}
}
Pages: 1 ... 4 5 [6] 7