Show Posts
Pages: 1 ... 155 156 [157] 158 159 ... 361
2341  Using Arduino / Programming Questions / Re: Program dont follow on: May 16, 2013, 03:34:44 am
Hello everybody. I have another problem. This is my code:

elseine, quote this post to see what code tags look like.
They will be in brackets [ ]. The edit window # button generates them or you can type them.

I made some additions to help you know what your code -is- doing.
It compiles but I have no servo to test with.

Code:
// Sweep
// by BARRAGAN <http://barraganstudio.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

byte ledPin = 13; // the built-in led on UNO and MEGA Arduinos
 
void setup()
{
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
  pinMode( ledPin, OUTPUT ); // default state is LOW
}
 
 
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(150);                       // waits 15ms for the servo to reach the position
  }

  digitalWrite( ledPin, HIGH ); // turn the Arduino led ON

  delay(10000);

  digitalWrite( ledPin, LOW ); // turn the Arduino led OFF

  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(150);                       // waits 15ms for the servo to reach the position
  }
}

2342  General Category / General Discussion / Re: Complete beginner, help for project appreciated on: May 15, 2013, 07:28:00 pm
You can use a led as a light sensor and colored leds to sense colored light. Using leds with colored bulbs to filter what gets in, only light of the emitted wavelength or shorter will be read but the bulb filters out the shorter - you can get color band strength. Do for Red, Green and Blue since what you see may be a mix.

It is slower than more costly sensors but faster than human and the cost is very low.

I have my own version of this project. Both work. It is not color-specific.
http://playground.arduino.cc//Learning/LEDSensor

Mitsubishi Labs white paper on using leds as sensors for communication and light level sensor using the same led that emits the light being controlled.
http://www.merl.com/reports/docs/TR2003-35.pdf

Liquid ID Spectrometer.
http://creative-technology.net/MAKE.html

See what your professor says. For less than 1 Euro you can add RGB detection to Arduino.


2343  General Category / General Discussion / Re: Throughhole version on: May 15, 2013, 07:04:56 pm
You can make a breadboard Arduino and program it with UNO as ISP or other programmer.
This is part of a view of Arduino as a development board to make stand-alone products.

http://arduino.cc/en/Main/Standalone

http://arduino.cc/en/Tutorial/ArduinoToBreadboard

If you use the minimal circuit in the 2nd link, the 328 chip you program only needs power and ground to run, the rest is connect the pins you would use.

http://www.instructables.com/id/The-RRRRRRRRRRBA-or-What-They-Dont-Teach-You-in-/

But -- CAVEAT -- none of those show a bypass capacitor between power and ground which you should include.

There is loads of these kind of things, like Arduino-on-a-chip and the V-USB projects and MIT High-Low Tech ATtiny ....



http://www.obdev.at/products/vusb/index.html
http://www.obdev.at/products/vusb/prjobdev.html

http://hlt.media.mit.edu/?p=1695

Yes, you don't have to use an ATMega328P. There are cores for other ATMEL chips available. The 1284 for example that Crossroads (a member here) has boards for is a heavyweight in terms of RAM, flash and EEPROM as well as pins for about $7. Yes, you can program that.

Best reason to buy an official Arduino is to support the people who made the IDE and this site.

2344  Using Arduino / Programming Questions / Re: string print methods on: May 15, 2013, 04:38:05 pm
I'm still trying to adapt my coding technique to the tiny amount of RAM available and I'm just a little nervous.

Using sprintf() only impacts RAM in the size of the string array you print to. The code goes to flash memory (which you have far more of, but that can get tight too), not RAM.
2345  Using Arduino / Programming Questions / Re: Issues with Pass Array of Structures to Library by Reference on: May 15, 2013, 04:30:25 pm
Little bit of simplifying. Try it out.

Code:
#include <UTFT.h>
#include <UTouch.h>

// #include <Forms4Utft.h>
// Forms4Utft forms;

struct F4Utft
{
  char name[ 10 ];
  int x;
  int y;
  char formatName[ 10 ];
};

const int DEF_MENU1 = 3;

F4Utft  tft[ DEF_MENU1 ] =
{
  "selStats", 15, 195, "BigFontS",
  "selGraph", 215, 195, "BigFontS",
  "line2", 15, 185, "None"
};

void setup()
{
  // For debugging messages
  Serial.begin(57600);
  byte i;

  Serial.println();
  for ( i = 0; i < DEF_MENU1; i++ )
  {
    Serial.print( i, DEC );
    Serial.print( "--->" );
    Serial.println( tft[i].name );
  }

  Serial.println();
  for ( i = 0; i < DEF_MENU1; i++ )
  {
    Serial.print( i, DEC );
    Serial.print( "--->" );
    Serial.println( test( tft + i ));
  }

  while (true); // never reaches loop()
}

void loop()
{
}

char *test(struct F4Utft* menu)
{
  return( menu->formatName );
}
2346  Community / Bar Sport / Re: UDOO --- hybrid board does Linux or Android with Arduino on: May 15, 2013, 11:51:49 am
I think that the point of evolution is new things finding their niche or not.

2347  Using Arduino / Programming Questions / Re: Issues with Pass Array of Structures to Library by Reference on: May 15, 2013, 10:56:53 am
That's nice. I think that maybe the best book I have on C/C++ was written by Kaare Christian for Borland C/C++. He was very good on technique, something not so easy to find.

If you want a neat language for address use, learn Forth.

2348  Development / Suggestions for the Arduino Project / Re: Is there a project to improve/replace the official examples? on: May 15, 2013, 08:33:20 am
My next step was to try and address organizing examples and knowledge as it has piled up and is frustrating trying to find solutions. We need a library card catalog equivalent or better.

But first, the examples. I made some changes to BlinkWithoutDelay since I send so many new people to that. BTW, there's 12 actual lines of code in this one.

Code:
/* Blink without Delay -- with minor fixes by GFS

  Turns on and off a light emitting diode(LED) connected to a digital 
 pin, without using the delay() function.  This means that other code
 can run at the same time without being interrupted by the LED code.
 
 The circuit:
 * LED attached from pin 13 to ground.
 * Note: on most Arduinos, there is already an LED on the board
 that's attached to pin 13, so no hardware is needed for this example.
 
 
 created 2005
 by David A. Mellis
 modified 8 Feb 2010
 by Paul Stoffregen
 
 This example code is in the public domain.
 
 http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay
 
 GFS fixes and modifications -- May 5 2013:
 . changed time variables to be ALL unsigned longs, as they should be.
 . added UL to numbers being assigned to unsigned longs as should be.
 . changed the variable name 'interval' to 'blinkTime' as interval is now a
 word used by the IDE, it shows up red (like the word 'if') instead of black.
 . changed the if-else logic to change the ledState variable to 1 line XOR logic.
 . added comments about adding more tasks to the sketch.
 
 */

// constants won't change. Used here to
// set pin numbers:
const byte ledPin =  13;      // the number of the LED pin

// Variables will change:
byte ledState = LOW;             // ledState used to set the LED

unsigned long previousMillis = 0UL;  // will store last time LED was updated

unsigned long blinkTime = 1000UL;  // interval at which to blink (milliseconds)

void setup()
{
  // set the digital pin as output:
  pinMode(ledPin, OUTPUT);     
}

void loop()
{
  unsigned long currentMillis = millis();
 
  // here is where you'd put code that needs to be running all the time.
 
  // GFS adds -- you see the if() { } block below? You can add more blocks
  // whether if() or switch-case or whatever to do other tasks and as long
  // as they run quick without delays or prolonged loops, your sketch will
  // be responsive as if everything runs at the same time.
  // just as the blink runs on time, another task can run when a button or
  // sensor or serial data comes in or changes.
  // simple commands run in less than a millionth of a second so you can pack
  // a good bit of process into a block and still run quick. analog read takes
  // longer, about 9 per millisecond so it's best not to do a bunch of those
  // in a row but instead 1 analog read per time through loop() so other tasks
  // can get a chance in between analog reads.
  // it's also good to avoid using floating-point as that is slooowww and avoid
  // using C++ Strings as they mess with your RAM and suck up CPU cycles doing it.

  // Back to the original program:
  // check to see if it's time to blink the LED; that is, if the
  // difference between the current time and last time you blinked
  // the LED is bigger than the interval at which you want to
  // blink the LED.
  if(currentMillis - previousMillis >= blinkTime) // is it time to change the led?
  {
    // save the last time you blinked the LED
    previousMillis = currentMillis;   

    // if the LED is off turn it on and vice-versa:
    ledState = ledState ^ 1; // ^ is logical XOR, true if the values are different
    // using logic operations can save a lot of tedious, pain to debug if's

    // set the LED with the ledState of the variable:
    digitalWrite(ledPin, ledState);
  }
}
2349  Using Arduino / Programming Questions / Re: Issues with Pass Array of Structures to Library by Reference on: May 15, 2013, 08:26:05 am
Also, always keep in mind that an array name, such as DefMenu, is exactly the same as the base address (i.e., the lvalue) of the array.

With a 2D array it is a bit more complicated to get at, but the address is there.

Quote
Therefore, if I want to march through an array using a for loop and want to look at things along the way, I need to use the address of a particular element of the array. That's why the address-of operator (&) is used in the call to your test() method.

To address an element I add the number of elements into the array to the base. Usually I assign that to a pointer but last night when I wrote that post and now I'm too tired to lay it all out. If I have something that I can & I don't need to compute an address.

Quote
Also, the indirection operator (i.e., *) is always used to fetch the contents of what it stored at a given memory address (i.e., the rvalue).

int A[ 10 ] = { 0,1,2,3,4,5,6,7,8,9 };

int *B = A + 5; // B is an int pointer now pointing at A[5]

int C = *B + 10; // C now == 15

*B = 21; // *B is A[5], the * makes the pointer act as the variable, A[5] now == 21

Here is a nice tutorial on pointers, better than I can write and more than I can post.
http://pw1.netcom.com/~tjensen/ptr/pointers.htm
2350  Using Arduino / Programming Questions / Re: Issues with Pass Array of Structures to Library by Reference on: May 15, 2013, 01:33:49 am
I am humbled to be back at the well so soon but I have spent the better part of the day fighting with pointers.   I am able to pass a pointer for one row of my structure but not for the entire structure.   I recognize that I am doing something stupid and would appreciate a [gentle] slap on the head...here is my code

Gently now, C pointers are just addresses with data type info. The details you write on a card until you get used to them again. Thank someone you're not trying to deal with trig and log identities, huh?

I can make a pointer to int and set it to the base of an int array of known dimensions. If I know how the array is arranged then I can reach any spot by adding a number to that base address.
Simple example.
int A[ 10 ] = { 0,1,2,3,4,5,6,7,8,9 };

the base pointer is A, the name of every 1 dimension array is a pointer
if I want the 1st element then

int X = *( A + 0 );

the * can be thought of as 'at'
the parens are to evaluate A + 0 as an address before using 'at' to reference it

in a loop or operation or arg passed to a function, ( A + i ) works as well.

or I can go A[ 0 ] or A[ i ] after passing A as the base address.

Multiple dimensions.
int A[][], the name A is a pointer to a pointer. But the entire array is still ints, one after the other 2 bytes wide so a simple int pointer can address the whole shebang and offsets are not really that hard to work out.

What goes for ints goes for structs.

In practice, use the basics to keep from getting completely lost and draw the occasional map of your data. I hope this helps, I'm sure it's stuff you know somewhere.

The first code I wrote that ran on a computer was Fortran 4 on punch cards in 1975. I'd hate to try Fortran today.
2351  Using Arduino / Programming Questions / Re: Averaging analog inputs without delay() help needed on: May 15, 2013, 01:07:04 am
I think I have to keep the two lines reading "Battery voltage is" though since I want two lines printed with different information right?

I dunno what you want there. I might make one longer line saying like
Battery voltage is LOW at 2.9V.

Quote
I attempted to change what I have as the battery reading averaging code to what you suggested with no luck.

That "might as well be" was not a suggestion to do that. It was an observation that you are using a loop to add the same value to an accumulated value 50 times. The averaging code is something else you should get help with (and a book) as it's been so long since I messed with statistics (1977) that I can't even remember the names of the methods.

Quote
Quote
I hope you like the state machine and see how simple one can be. If need be you can run code on several state variables but take care that they don't step on each other.
Yeah, the state machine is very cool, it was kind of hard to understand at first, but after looking it over a few times and changing different things I am starting to understand it better. Very powerful.

Beginner programming teaches a start - middle - end approach which fits a lot of things done with computers. But real time code only ends when the user chooses, power runs out or you hit a nasty bug. Otherwise it goes around and around keeping track of what went on to know what to do with what goes on.

Quote
I must say that it is exciting to see how many different ways there are to do similar things in C. I have never messed with any kind of programming until I started with this project and it really plows me away with how it can be so complex, yet simple at the same time.

Keep it simple and use the Feynmann learning technique when something looks hard.
https://www.youtube.com/watch?v=FrNqSLPaZLc
You can probably find more on that in a book in one of those places they keep lots of books.  smiley-grin

I grew up on pencil and paper. It slows you down, gives you time to think and if you're good it gives you a record or picture of what you have done or want to do. Thinking at the keyboard I find rushes things and you end up with something you can't see the whole of at once.

Quote
I have always worked with the hardware side of things in the past and it is neat to cross over to the software side of things now too.

It just gets better and learning cross-discipline lets you talk better with that crowd that can't change a lightbulb because it's a hardware problem (old joke, how many programmers does it take to....).
2352  Using Arduino / Project Guidance / Re: comparing an array of inputs on: May 15, 2013, 12:39:01 am
I made a mistake earlier, I actually need 16 inputs.  can I still use the byte format?  I am using a mega2560.  I was hoping I could Just digital read all the inputs, subtract the two arrays, and then if the value was >0 increment a value.  Im not a great programmer, and my education is in electronics not programming.  Its just a final project before I graduate.  I got everything done but the arrays.  I seen this code and thought it would be good to use but can't get it to work.  This is what I was Trying.  No need to laugh when you see it  smiley-grin

Code:
void sensorControlLoop(){
  
  unsigned long sensMillis = millis();
  long prevSensMillis = 0;
  long sensInterval = 1000;
  int n;
    int pinArray1[16];
    int pinArray2[16];
    pinArray1[0] = digitalRead(31);
    pinArray1[1] = digitalRead(32);
    pinArray1[2] = digitalRead(33);
    pinArray1[3] = digitalRead(34);
    pinArray1[4] = digitalRead(35);
    pinArray1[5] = digitalRead(36);
    pinArray1[6] = digitalRead(37);
    pinArray1[7] = digitalRead(38);
    pinArray1[8] = digitalRead(39);
    pinArray1[9] = digitalRead(40);
    pinArray1[10] = digitalRead(41);
    pinArray1[11] = digitalRead(42);
    pinArray1[12] = digitalRead(43);
    pinArray1[13] = digitalRead(44);
    pinArray1[14] = digitalRead(45);
    pinArray1[15] = digitalRead(46);
    
    if(sensMillis - prevSensMillis > sensInterval){
      pinArray2[0] = digitalRead(31);
      pinArray2[1] = digitalRead(32);
      pinArray2[2] = digitalRead(33);
      pinArray2[3] = digitalRead(34);
      pinArray2[4] = digitalRead(35);
      pinArray2[5] = digitalRead(36);
      pinArray2[6] = digitalRead(37);
      pinArray2[7] = digitalRead(38);
      pinArray2[8] = digitalRead(39);
      pinArray2[9] = digitalRead(40);
      pinArray2[10] = digitalRead(41);
      pinArray2[11] = digitalRead(42);
      pinArray2[12] = digitalRead(43);
      pinArray2[13] = digitalRead(44);
      pinArray2[14] = digitalRead(45);
      pinArray2[15] = digitalRead(46);
      
      if (array_cmp(pinArray1, pinArray2, 16, 16) == false){
        ++alarmCount;
        if(alarmCount==10){
          digitalWrite(alarmPin, HIGH);
         }
      }
      else{
        alarmCount = 0;
       }    
    }
}
 boolean array_cmp(int *pinArray1, int *pinArray2, int len_a, int len_b){
      int n;

      // if their lengths are different, return false
      if (len_a != len_b) return false;

      // test each element to be the same. if not, return false
      for (n=0;n<len_a;n++) if (pinArray1[n]!=pinArray2[n]) return false;

      //ok, if we have not returned yet, they are equal :)
      return true;
}void sensorControlLoop(){
  
  unsigned long sensMillis = millis();
  long prevSensMillis = 0;
  long sensInterval = 1000;
  int n;
    int pinArray1[16];
    int pinArray2[16];
    pinArray1[0] = digitalRead(31);
    pinArray1[1] = digitalRead(32);
    pinArray1[2] = digitalRead(33);
    pinArray1[3] = digitalRead(34);
    pinArray1[4] = digitalRead(35);
    pinArray1[5] = digitalRead(36);
    pinArray1[6] = digitalRead(37);
    pinArray1[7] = digitalRead(38);
    pinArray1[8] = digitalRead(39);
    pinArray1[9] = digitalRead(40);
    pinArray1[10] = digitalRead(41);
    pinArray1[11] = digitalRead(42);
    pinArray1[12] = digitalRead(43);
    pinArray1[13] = digitalRead(44);
    pinArray1[14] = digitalRead(45);
    pinArray1[15] = digitalRead(46);
    
    if(sensMillis - prevSensMillis > sensInterval){
      pinArray2[0] = digitalRead(31);
      pinArray2[1] = digitalRead(32);
      pinArray2[2] = digitalRead(33);
      pinArray2[3] = digitalRead(34);
      pinArray2[4] = digitalRead(35);
      pinArray2[5] = digitalRead(36);
      pinArray2[6] = digitalRead(37);
      pinArray2[7] = digitalRead(38);
      pinArray2[8] = digitalRead(39);
      pinArray2[9] = digitalRead(40);
      pinArray2[10] = digitalRead(41);
      pinArray2[11] = digitalRead(42);
      pinArray2[12] = digitalRead(43);
      pinArray2[13] = digitalRead(44);
      pinArray2[14] = digitalRead(45);
      pinArray2[15] = digitalRead(46);
      
      if (array_cmp(pinArray1, pinArray2, 16, 16) == false){
        ++alarmCount;
        if(alarmCount==10){
          digitalWrite(alarmPin, HIGH);
         }
      }
      else{
        alarmCount = 0;
       }    
    }
}
 boolean array_cmp(int *pinArray1, int *pinArray2, int len_a, int len_b){
      int n;

      // if their lengths are different, return false
      if (len_a != len_b) return false;

      // test each element to be the same. if not, return false
      for (n=0;n<len_a;n++) if (pinArray1[n]!=pinArray2[n]) return false;

      //ok, if we have not returned yet, they are equal :)
      return true;
}

This is the reference Code I was looking at and the address. http://forum.arduino.cc/index.php/topic,5157.0.html
Code:
boolean array_cmp(int *a, int *b, int len_a, int len_b){
      int n;

      // if their lengths are different, return false
      if (len_a != len_b) return false;

      // test each element to be the same. if not, return false
      for (n=0;n<len_a;n++) if (a[n]!=b[n]) return false;

      //ok, if we have not returned yet, they are equal :)
      return true;
}

int arr_a[] = {1, 4, 7, 1, 3};
      int arr_b[] = {1, 4, 7, 2, 3};

      if (array_cmp(arr_a, arr_b, 5, 5) == true){
            // do this if they are equal
      }else{
            // do this if they are different
      }

If you still have reasonable time then not panicking will serve you.

An unsigned int is 16 bits and with a MEGA2560 you can arrange those as the pins on two Ports and read them in two Port reads.

You can compare 2 different times using XOR of two unsigned ints. Unsigned ints because signed ints use the top bit as sign.

My oh my, you have an array compare function that includes the lengths of the arrays with logic on if they differ? But they should never differ in length, should they?

I see that you get as far as comparing arrays and if they are different, light up a led. Is that it? Is that all you need to do? That would be a blessing, just tell IF there was movement and not actually from where to where!

Without using Port reads this:
Code:
    pinArray1[0] = digitalRead(31);
    pinArray1[1] = digitalRead(32);
    pinArray1[2] = digitalRead(33);
    pinArray1[3] = digitalRead(34);
    pinArray1[4] = digitalRead(35);
    pinArray1[5] = digitalRead(36);
    pinArray1[6] = digitalRead(37);
    pinArray1[7] = digitalRead(38);
    pinArray1[8] = digitalRead(39);
    pinArray1[9] = digitalRead(40);
    pinArray1[10] = digitalRead(41);
    pinArray1[11] = digitalRead(42);
    pinArray1[12] = digitalRead(43);
    pinArray1[13] = digitalRead(44);
    pinArray1[14] = digitalRead(45);
    pinArray1[15] = digitalRead(46);

can change to this:
Code:
// up near the top of the code, declaring 2 global variables
  unsigned int matBits;
  unsigned int lastBits = 0xFFFF; // 0x denotes hexadecimal notation. 0xFFFF is all bits set
....
then we go down into loop() for the reads
....
  for ( byte i = 31; i < 47; i++ )
  {
    bitWrite( matBits, i - 31, digitalRead( i ) );
  }

  if ( matBits != lastBits )
  {
    then light the alarm led or compare the bits to find out which changed, etc
  }

  lastBits = matBits;
  delay( 250 );
} // end of loop()

Magic part. You only read the pins once per time through loop. Then you compare that read to the last time through loop. And maybe you check more often than 4 times a second which the delay( 250 ) is for, so perhaps no delay() and get immediate response to all changes which is better BTW.

Coding loop() to handle what is going on NOW with variables holding states determined in PAST executions of loop() affecting how results from NOW are used is how to code for REAL TIME. In PC code this is often done by placing a while-loop in the main code and it is generally referred to as the MAIN LOOP. I go back to the 70's there but it's probably as old as operating systems.

You are a EE major? Have you gotten to logic gates yet? The software logical operations are equivalent to logic gates. The bitwise logical operations are equivalent to working with arrays of logic gates which actually on the chip level THEY ARE.
2353  Community / Bar Sport / UDOO --- hybrid board does Linux or Android with Arduino on: May 14, 2013, 06:44:38 pm
I'm thinking "send them $5 and maybe get a board a tiny bit sooner than never".

http://www.kickstarter.com/projects/435742530/udoo-android-linux-arduino-in-a-tiny-single-board?ref=card


    Freescale i.MX 6 ARM Cortex-A9 CPU Dua/Quad core 1GHz
    Integrated graphics, each processor provides 3 separated accelerators for 2D, OpenGL® ES2.0 3D and OpenVG™
    Atmel SAM3X8E ARM Cortex-M3 CPU (same as Arduino Due)
    RAM DDR3 1GB
    54 Digital I/O + Analog Input (Arduino-compatible R3 1.0 pinout)
    HDMI and LVDS + Touch (I2C signals)
    Ethernet RJ45 (10/100/1000 MBit)
    WiFi Module
    Mini USB and Mini USB OTG (micro with the final release)
    USB type A (x2) and USB connector (requires a specific wire)
    Analog Audio and Mic
    SATA (Only Quad-Core version)
    Camera connection
    Micro SD (boot device)
    Power Supply (5-12V) and External  Battery connector

2354  Using Arduino / Project Guidance / Re: comparing an array of inputs on: May 14, 2013, 06:37:46 pm
What TH posted only with more details:

You can keep the status of those 8 pins in a bit array, otherwise known as a byte.

You can use bitRead(), bitWrite(), bitSet() and bitClear() to work with the bits and/or the bitwise operators, the shifts and logic operations. All those are found here:
http://arduino.cc/en/Reference/HomePage

If you have a pattern 11111011 that changes to 11110111 then XOR the two and get 00001100 showing the bits that changed (the 1's in the result) and work it from there.

If you arrange which parts of the mat match which bits then bit position might be something you can use in your algorithm, relating spatial movement to bit movement.

Yes it requires knowing or learning bits and bit logic. Is using a variable-per-sensor array going to be easier because you don't have to learn bits? Well there's not all that much to bits and bit logic and by using those you can compare all 8 sensors in one operation while using arrays will require looping and extra variables.

If you are using an UNO then you can read all 8 sensors in 2 direct Port reads (search on Port Manipulation). All UNO Ports have some pins tied up by default. The MEGA2560 has some ports with all 8 pins (bits) open for use, you can read the whole mat in one operation.

Do some studying and ask questions before you choose a path, and you will be better prepared either way.

2355  Using Arduino / Programming Questions / Re: Strange Characters in Serial Monitor on: May 14, 2013, 10:44:35 am
You set the Arduino serial baudrate to 57600. Did you set Serial Monitor to match?
Pages: 1 ... 155 156 [157] 158 159 ... 361