Show Posts
Pages: [1] 2 3 ... 11
1  Using Arduino / Programming Questions / Re: Get correctly the sizeof() on: September 03, 2014, 10:06:39 am
I understand that 48 or 52 byte arrays does not make a big difference.
the arrays that i need for difference sorting and indexing have from 20-30 instances. This also does not have big difference except if i know the excatck amound of memory space each instance and array gets which i do not in order to calculate the maximum instance i can hav eand the maximum number of arrays with the  exact size.


also i suppose that except the irony  the suggestion of the struct instead of a class is your only proposal?
2  Using Arduino / Programming Questions / Re: Get correctly the sizeof() on: September 03, 2014, 09:50:10 am
i am talking about 50 byte arrays and the same number of container objects and some 5-6 arrays for indexing them. I am having this problem with SRAM and i am trying to deal with.Any solution?
3  Using Arduino / Programming Questions / Re: Get correctly the sizeof() on: September 03, 2014, 06:14:21 am
i am making a class that has the byte array and the legnth. And i will use the objects.

I wanted to not to declare all the byte arrays and then all the structs or the objects of the class.I wanted to declare the class and then make object that when i create them i pass the byte array.

and then make an array of the objects of the class
4  Using Arduino / Programming Questions / Re: Get correctly the sizeof() on: September 03, 2014, 05:59:34 am
it really does.and i can not explain it why it is 1.

I am going to use a container to store the size and the byte array anyway.

I have one more question plz.

I am declaring the container that in the constructor gets the byte array and the sizeand makes an object that i can use.I do not want to declare and initialize 234(not the real number) byte arrays and then 234 containers in order to do this.

Code:
byte A[]={B01111110,B10001000,B10001000,B10001000,B01111110};
Container* A=new Container(A,5);

i want to do it like this in one line

Code:
Container* A=new Container({B01111110,B10001000,B10001000,B10001000,B01111110},5)

It give error on of non matching funtion for call to 'Container::Container(<brace-enclosed initializer list>,int)'

the constructor is

Code:
Container::Container(byte character[],int size) {
this->character=character;
this->size=size;
5  Using Arduino / Programming Questions / Re: Get correctly the sizeof() on: September 03, 2014, 05:34:34 am
i am going to make it a container probably to hold the size also cause every byte array does not the same size some have 3 bytes
6  Using Arduino / Programming Questions / Re: Get correctly the sizeof() on: September 03, 2014, 04:56:14 am
So there is no way to do it this way i will have to manage something else then?
7  Using Arduino / Programming Questions / Get correctly the sizeof() on: September 03, 2014, 04:40:07 am
I have several byte arrays and an array of that byte arrays.
I need to get the size of the byte array in a certain index.

Code:

byte A[]={B01111110,B10001000,B10001000,B10001000,B01111110};
byte B[]={B11111110,B10010010,B10010010,B10010010,B01101100};
byte gamma[]={B11111110,B10000000,B10000000,B10000000,B10000000};

byte *test[]={A,B,gamma}

Serial.println(sizeof(gamma));
Serial.println(sizeof(test[2]));


The first serial pront gives 5 that is correct the second give 2(probably the size of the pointer).

How can i get the correct result cause i want to use the test in a for loop or i will have to use nested else if.
8  Using Arduino / Programming Questions / Re: I2C transmission on RA8875 on: May 07, 2014, 08:06:21 am
Please check the photos in order to understand what i am asking. in order to write to a register you have to start the communication send the register and then  read or write data to it. The first byte that it is send has the address of the device and the type of the command(read/write) and then you send the register you want to write or the one that you want to read.I was wandering if the request from or the begingTransmittion is that first byte according the photos.

Also i need to know if it is the correct way to use the requestfrom function is this way:

1)beginTransmittion
2)wire.write(0)
3)endTransmittion
4)requestioFrom
5)wire.read()
9  Using Arduino / Programming Questions / I2C transmission on RA8875 on: May 07, 2014, 05:51:05 am
I have the datasheet of RA8875 and i want to setup the I2C protocol. I have added pages from the datasheet for the I2C
 I need to know if beginTransmittion(address) sends the first the first byte to the slave device the IICA[5:0](that contains the address plus the RS/RW. If this is correct does the next function could do the work?
The same question exist for the function requestfrom(address,bytes);
 
Code:
void  RA8875::writeCommand(uint8_t d)
{
Wire.beginTransmission(write_cmd_addr);//write_cmd_add=0x0e
Wire.write(d);
Wire.endTransmission();
}

serveral codes before when reading before request from use beginTransmissino(addesss) followed by a Wire.write(0) and endTransmittion(). The the use requestfrom(ardderss,bytes).

Isn't it correct if i do just requestfrom and then wire.read() ass shown in one of the sites examples?

Also the photos show that there is an Anckowledge bit that i do not know how to implement it
10  Using Arduino / Programming Questions / Re: definition of type bit for arduino on: May 01, 2014, 04:11:51 pm
Did you mean to delete the upload of the cpp file of the code i shared before? This is done but i do not know why this was a problem?
11  Using Arduino / Programming Questions / Re: definition of type bit for arduino on: May 01, 2014, 04:05:16 pm
I am not exactly following what you are saying, if you can anylise it a bit it would be wonderful
12  Using Arduino / Programming Questions / Re: definition of type bit for arduino on: April 30, 2014, 01:55:29 pm
So the only way is to write the i2c communication with the RA8875 from the beginning i suppose and not to steal it from the demo that  they give
13  Using Arduino / Programming Questions / definition of type bit for arduino on: April 30, 2014, 01:15:58 pm
I need to tranfer a code for a tft made for C51 to arduino.In the code there is the type bit that is used for the spi and the iic protocol. bit tho is not defind for the arduino is there any solution?i give the code

[
14  Using Arduino / Displays / 7" tft Ra8875 with arduino Uno on: April 25, 2014, 09:49:04 am
I am using a mutitouch 7" tft lcd with the RA8875 chipset

I have a problem wit the communication.
I took the Adafruit_GFX lib from gifhub and the RA8875 lib they developed and managed to compile correctly. I fell into an infinite loop tho. The buildtest sketz uses spi mode 0 and and clock divider at 128 (i think that spi mode is 3 cause of the figure 6-18 in page 65 of the datasheet(tho it did not worked also). Also the sketz tries to read a register 0x0h i think and and returns false (witch goes in the infinite loop) if the value is not 75? I am trying to find this register in the datasheet to check its normal value in order to find where is the problem.
Why after initializetion function library changes the clockdivider?

The code from the lib i am talking about is this:

Code:
     boolean Adafruit_RA8875::begin(enum RA8875sizes s) {
      _size = s;

      if (_size == RA8875_480x272) {
        _width = 480;
        _height = 272;
      }
      if (_size == RA8875_800x480) {
        _width = 800;
        _height = 480;
      }

      pinMode(_cs, OUTPUT);
      digitalWrite(_cs, HIGH);
      pinMode(_rst, OUTPUT);
      digitalWrite(_rst, LOW);

      digitalWrite(_rst, LOW);
      delay(100);
      digitalWrite(_rst, HIGH);
      delay(100); SPI.begin();
      SPI.setClockDivider(SPI_CLOCK_DIV128);
      SPI.setDataMode(SPI_MODE0);
     
      if (readReg(0) != 0x75) {
        return false;
      }

      initialize();

      SPI.setClockDivider(SPI_CLOCK_DIV4);

      return true;

After setting the spi mode in the code i did a few changes to test spi connection

Code:
  uint8_t x=readReg(0);
  Serial.println(x);

  writeReg(0,0x20);
  Serial.println(readReg(0));
  Serial.println(readReg(0x01));
  Serial.println(readReg(0x02));

The result in the terminal was the same every register give result 255

Quote
RA8875 start
255
255
255
255
RA8875 Not Found!

the last line is cause of the return of False and then the program goes to an infinite loop.
The 7" tft is this:
http://www.buydisplay.com/default/7-inch-lcd-module-capacitive-touch-screen-panel-i2c-spi-serial

Any help to make it work?
15  Using Arduino / Programming Questions / arduino robot lib error on: April 23, 2014, 06:13:16 pm
I am using adafruit R8875 lib for the same chipset with adafruit_glx graphic lib.These 2 libs use robot_control lib. My problem is that i get a compile error from the last lib.

The error is this and it is the same even if i try to compile an example from the arduino robot library


Quote
C:\Program Files\arduino\libraries\Robot_Control\ArduinoRobot.cpp: In constructor 'RobotControl::RobotControl()':
C:\Program Files\arduino\libraries\Robot_Control\ArduinoRobot.cpp:8: error: 'LCD_CS' was not declared in this scope
C:\Program Files\arduino\libraries\Robot_Control\ArduinoRobot.cpp:8: error: 'DC_LCD' was not declared in this scope
C:\Program Files\arduino\libraries\Robot_Control\ArduinoRobot.cpp:8: error: 'RST_LCD' was not declared in this scope
C:\Program Files\arduino\libraries\Robot_Control\ArduinoRobot.cpp: In member function 'void RobotControl::begin()':
C:\Program Files\arduino\libraries\Robot_Control\ArduinoRobot.cpp:18: error: 'MUXA' was not declared in this scope
C:\Program Files\arduino\libraries\Robot_Control\ArduinoRobot.cpp:18: error: 'MUXB' was not declared in this scope
C:\Program Files\arduino\libraries\Robot_Control\ArduinoRobot.cpp:18: error: 'MUXC' was not declared in this scope
C:\Program Files\arduino\libraries\Robot_Control\ArduinoRobot.cpp:18: error: 'MUXD' was not declared in this scope
C:\Program Files\arduino\libraries\Robot_Control\ArduinoRobot.cpp:19: error: 'MUX_IN' was not declared in this scope
C:\Program Files\arduino\libraries\Robot_Control\ArduinoRobot.cpp:22: error: 'BUZZ' was not declared in this scope
C:\Program Files\arduino\libraries\Robot_Control\ArduinoRobot.cpp:25: error: 'Serial1' was not declared in this scope

Any solution?
Pages: [1] 2 3 ... 11