Show Posts
Pages: [1] 2 3 ... 1862
1  Using Arduino / Programming Questions / Re: Problem with Serial.print after adding FOR loop on: Today at 01:36:01 am
41 * 256 = ?

does it help if i were to store in the ROM memory of the microcontroller?
Yes, but remember, without rewriting the bootloader, that's going to be a compile-time only set of constants.
2  Using Arduino / Programming Questions / Re: Problem with Serial.print after adding FOR loop on: Today at 12:37:01 am
41 * 256 = ?
3  Using Arduino / Project Guidance / Re: Program stops outputting text on serial monitor after a certain point on: July 31, 2014, 04:23:53 pm
Please read the posting guidelines relating to the use of code tags, and consider the amount of RAM you're using all those strings
4  Using Arduino / Programming Questions / Re: Help with Platform I/o definitions on arduino on: July 31, 2014, 04:13:05 pm
It's difficult to guide someone when you don't know what part of the path they can't see.
You have all the source, so you can see everything I can see.

5  Using Arduino / Programming Questions / MOVED: battery mAh tester on: July 31, 2014, 03:58:29 pm
This topic has been moved to General Electronics.

http://forum.arduino.cc/index.php?topic=258338.0
6  Using Arduino / Programming Questions / Re: How to read values over serial on: July 31, 2014, 03:49:04 pm
I prefer us over degrees for better precision.
7  Using Arduino / Programming Questions / Re: Saving int arrays to EEPROM? on: July 31, 2014, 03:47:49 pm
It's an unfortunate coincidence that the number of rows is the same as the number of bytes in an int in your first example.
8  Using Arduino / Programming Questions / Re: LED/Photocell on: July 31, 2014, 03:44:06 pm
Yup, ten into eight don't go.
9  Using Arduino / Project Guidance / Re: Serial Port Data Transfer Problem (Weird Character) on: July 31, 2014, 03:26:09 pm
Well, you can either not send it, or not display it.
If you're not up to fixing VB (I'm certainly not), I'd go with filtering out on the Arduino side.
10  Using Arduino / Project Guidance / Re: Serial Port Data Transfer Problem (Weird Character) on: July 31, 2014, 03:17:44 pm
Carriage Return / Line Feed

A throwback to mechanical teletypes.
11  Using Arduino / Programming Questions / Re: How to read values over serial on: July 31, 2014, 03:11:16 pm
Quote
Can atoi be useful in this?
Maybe, but printing char(acters) as char(acters) rather than as "int"s may yield simpler results.
12  Using Arduino / Programming Questions / Re: How to read values over serial on: July 31, 2014, 02:52:02 pm
Evidently, given that you are expecting the packet: "W128", AWOL is too subtle:
It's probably my only failing.  smiley-cool
13  Using Arduino / Project Guidance / MOVED: Measuring CPU and GPU Temperatures on: July 31, 2014, 02:39:18 pm
This topic has been moved to Interfacing w/ Software on the Computer .

http://forum.arduino.cc/index.php?topic=257930.0
14  Using Arduino / Programming Questions / Re: Saving int arrays to EEPROM? on: July 31, 2014, 02:36:41 pm
I have an entirely rational aversion to magic numbers.
(Uncompiled, untested)
Code:
#include <EEPROM.h>

const byte ROWS = 2;
const byte COLS = 8;
const int ADDRESS_OFFSET = 50;

int my2dArray[ROWS][COLS] =
{
  {0x8888, 0x9999, 0xAAAA, 0xBBBB, 0xCCCC, 0xDDDD, 0xEEEE, 0xFFFF},
  {0x9999, 0xAAAA, 0xBBBB, 0xCCCC, 0xDDDD, 0xEEEE, 0xFFFF, 0x8888}
};

void setup(){
  Serial.begin(9600);

  int address;

  Serial.println ("Writing data.....");

  for(int j=0; j<ROWS; j++){

    Serial.println();

    for(int i=0; i<COLS; i++){

      EEPROMWriteInt(address= ((ROWS*i)+(j * COLS * sizeof (my2dArray [0][0]))+ ADDRESS_OFFSET), my2dArray[j][i]);
      Serial.println(address);
     
    }
  }
  Serial.println();
  Serial.println();
  Serial.println ("Reading data.....");

  for(int j=0; j<ROWS; j++){

    Serial.println();

    for(int i=0; i<COLS; i++){

      unsigned int value= EEPROMReadInt(address=(ROWS*i)+(j*COLS*sizeof (my2dArray [0][0]))+ADDRESS_OFFSET);
      Serial.print(address);
      Serial.print('\t');
      Serial.println(value,HEX);

    }
  }
}

void loop(){
}

//integer read/write functions found at http://forum.arduino.cc/index.php/topic,37470.0.html
//This function will write a 2 byte integer to the eeprom at the specified address and address + 1

void EEPROMWriteInt(int p_address, int p_value)
{
  byte lowByte = ((p_value >> 0) & 0xFF);
  byte highByte = ((p_value >> 8) & 0xFF);

  EEPROM.write(p_address, lowByte);
  EEPROM.write(p_address + 1, highByte);
}

//This function will read a 2 byte integer from the eeprom at the specified address and address + 1
unsigned int EEPROMReadInt(int p_address)
{
  byte lowByte = EEPROM.read(p_address);
  byte highByte = EEPROM.read(p_address + 1);
  return ((lowByte << 0) & 0xFF) + ((highByte << 8)& 0xFF00);

}
15  Using Arduino / Motors, Mechanics, and Power / Re: Servo Randomly Turns to 180 degrees on: July 31, 2014, 02:06:27 pm
Code:
     if (brakeVal > 10);
Oops
Pages: [1] 2 3 ... 1862