Show Posts
Pages: 1 2 [3] 4 5
31  Topics / Home Automation and Networked Objects / Bluetooth Debugging Assistant for Andriod on: July 27, 2011, 02:18:29 am
Imagine using your cell phone to communicate with Arduino, so you can see the electricity consumption of each electric equipment, turn on/off  them like TV , fan just using the software on your phone. we are now to turn it into reality step by step.
Here we release an "ITEAD BT Debugging Assistant", you can use in on your Android cell phone to communicate with Arduino boards by our Arduino BT shield or BTBee module.


When the BT shield or BTBee power on, you can use the "Search Device" to scanting them:


Click the device that you want to connect with, the cell phone will pop-up a window for entering the PIN code, you can find the PIN code in BT Shield or BTBee datasheet, it's "1234".


After connect with the Bluetooth device, software will Automatically goes into Monitor:


In the Monitor , you can type the char or string you want to send to Arduino in the input box, and press the "Send" button, the data will be sent to the Bluetooth device, and the Arduino or PC can read them by Serial port from BT shield or BTBee easily. You can select the "Send as New Line", then the software will add the "0x0D 0x0A" after your data.

ITEAD BT Debugging Assistant also support HEX send, it means you not just send out the char or string ASCII code out but you can send out the specific data you need. When you select the "Send as Hex" selection, you just can input the 0-9 or A-F, and if you type the 1234 in the input box, press "Send", the Bluetooth device will receive "0x12 0x34" but "0x31 0x32 0x33 0x34".


When your cell phone receive the data from Bluetooth , it will show on the Monitor display area, and show as string.


You can select the "View as Hex" to change the display, ITEAD BT Debugging Assistant will show you the data in HEX mode:


You can download the ITEAD BT Debugging Assistant here: http://iteadstudio.com/application-note/make-arduino-talk-with-android-by-bluetooth
we provide the apk install package, also the project source code - if you find any bug please let us know, any suggestions will be appreciated.
32  Community / Bar Sport / Re: Android Open Accessory Toolkit - Interface with Arduino on: May 18, 2011, 09:28:41 am
we have made the bare PCBs out and going to build a prototype one, now the bare PCB is sold here for some one who may need it:
http://iteadstudio.com/store/index.php?main_page=product_info&cPath=19_21&products_id=412
33  Using Arduino / Displays / Re: looking for cheap programmable displays? on: March 30, 2011, 02:32:35 am
 smiley-razz Nokia 5110 at $7.5 $6.8 : http://iteadstudio.com/store/index.php?main_page=product_info&cPath=3&products_id=155&zenid=efscc20sp8decajjrr1r3pu8d0
 And a shield that make it easy with Arduino : http://iteadstudio.com/store/index.php?main_page=product_info&cPath=18&products_id=308&zenid=c6rgrsh9jksigfrkk6j5sp3sa1

 smiley-draw  [Disclaimer - This is our online shop]  - -After I reply the pose and now get a new 3x3 keypad shield that also compatible with Nokia 5110: http://iteadstudio.com/store/index.php?main_page=product_info&cPath=18&products_id=351

Still looking for some more idea of the shield using this 5110 screen ,may be a joystick with 2 circle button smiley-wink
34  Development / Other Software Development / Re: Implementation for Microchip ENC28J60 Ethernet controller on: March 30, 2011, 12:59:46 am
We make a slight change on the code and now it can work with our IE shield with D8 pin config  smiley-lol

http://arduino.cc/forum/index.php/topic,57006.0.html

35  Community / Products and Services / Re: RGB LED Matrix Driver Platform : Colorduino v1.3 on: March 30, 2011, 12:56:30 am
we are in Shenzhen,China  smiley You can contact us by info@iteadstudio.com
36  Community / Products and Services / ENC28J60 Ethernet shield with POE & SD slot - IE shield v1.0 on: March 30, 2011, 12:52:05 am
 IE shield v1.0 is a Ethernet shield which use the ENC28J60 Etherent ship instead of the W5100 Ethernet chip. And it integrated the SD slot and may interface breakout.


This Ethernet shield support the POE function, you can use use the twisted-pair to power it and the Arduino board below, instead using the USB prower or external power jack supply. If your router or moden don't support POE, then you can use this cable to mix the signale and power for POE supply.

There is many interface breakout on board. There is a Ethernet SPI control interface on the board, which the same breakout as our ENC28J60 module.

And there are IIC and UART interface on board, some AD interface and GPIO interface.  Now you are very easy to make your Ethernet arduino project with variety existing sensor module. And we reserve an PWM/AD interface on board, you can use it as a PWE output and with some components it will be a sample DA ouput.

You can download the datasheet , schematic and some library in the product page here:
http://iteadstudio.com/store/index.php?main_page=product_info&cPath=18&products_id=349

 
37  Community / Products and Services / RGB LED Matrix Driver Platform : Colorduino v1.3 on: March 16, 2011, 01:12:24 pm
The Colorduino is a RGB LED matrix driver platform basis on ATMega 328P. This design is to make user easily modify or write the firmware of Colorduino by Arduino IDE.


The driver circuit based on 3 MBI5168 constant current sink drivers and a M54564 darlington source driver, the Colorduino pairs the M54564 with a single DM163 constant current driver. In order to better drive the RGB matrix and reach their best performance, we use the professional LED driver chip DM163 on board, by using the DM163, the Colorduino gains three 8+6-bit channels of hardware PWM control of the LED’s freeing up the ATMega328P from having to implement it in software. And the DM163 comprises shift registers, data latches, 8×3 channel constant current and 64 x 256 gray level PWM for per color! Each channel provide a maximum current of 60 mA. So, each RGB dot has 256×256x256  = 16,777,216 colours (16 million) in theory, and it’s easy to use the 6bit correction register to calibrate the current error for each color LEDs


Power is supplied either by pin headers or via 2 sets of mini screw terminals, a slide switch selecting between the two. With the herder side, you just can use the 5V power supply, and in the terminal side, now support 6.2-7.5V power supply, more than 7V will cause the DM163 fever and more than 9V supply may burn your board. Pins brought out the edge of the board include RX, TX and DTS, which can be used to reprogram the onboard ATmega chip, and SCA and SCL for I2C communication. A green LED on the front of the board indicates power, although it is mostly obscured as soon as you plug the matrix panel in.

If you have an Arduino UNO, but just want to drive the RGB LED Matrix, you can consider this Colors shield, it's compatible with Colorduino v1.3.

Product Page:
http://iteadstudio.com/store/index.php?main_page=product_info&cPath=1&products_id=337
Colorduino Library for Arduino: http://blog.lincomatic.com/?p=148
38  Community / Products and Services / Stackable Bluetooth Shield on: March 03, 2011, 01:28:50 pm
We have a BT shield v1.1,it is a serial port Bluetooth module (Slave) breakout board, and it compatible with Arduino, can directly plug in with Arduino and use the UART port for Bluetooth communication. But just to make a simple breakout , it also has many flaws : can not work with other shield together, just support 5V voltage interface, can not simply switch to different channel, etc.

Now we release this v2.0 version with HC-06, it has many improves from the previous shield.


What’s new?
1 Now we make the full Arduino footprint , and add the stackable socket for connecting with other Arduino shield like Ethernet shield , SD card shield.


2 Add a power switch for the shield, now you not just use it with some 5V interface board like Arduino, but also now can compatible with many other 3v3 boards like IFAT-32, Leaf Maple, and so on.


3 The BT shield v1.1 just can communicate with Arduino board, and it’s inconvenient to change its setting by AT command through USB. Now the new board has a switcher, you can change the module connection, so when you put the switcher to the “To Board” side, it can control by Arduino or IFLAT32, but to “To FT232” side, it connect to the FT232D IC, you can use the Arduino IDE or other serial monitor software to send it the AT command.


4 In the free area, we provide you a prototype area, and you can build a small circuit there for your Bluetooth project.


Get the datasheet , schematic and demo code on the product page here: http://iteadstudio.com/store/index.php?main_page=product_info&cPath=18&products_id=307
39  General Category / General Discussion / Re: 433Mhz RF Link Kit modules on: February 27, 2011, 02:37:45 pm
I get the maximum distance is 80m in open air with 12V power supply, although the supplier said that it can work with 9V at max 200m ...

40  Using Arduino / Storage / TinyFAT Library on: February 27, 2011, 02:00:36 pm


The SDuFAT library has some basic function for file log, can not meet some more complex requirements. Now Henning Karlsen publish a TinyFAT library and it’s really more powerful than former. And it had been designed to integrate with ITDB02_Graph and ITDB02_Graph16 - so now you can easy to use this library to read out the image in the SD cards and display on ITBD02 LCD module.

The library supports FAT16 formatted SD cards up to 2GB in size. 4GB FAT16 formatted SD cards might work, but is untested. Long filenames are not supported. Keep you filenames compliant with the old 8.3 standard.

The SD card should be connected to the SPI-pins on your Arduino. The Stackable SD Card Shield is compatible with it.


Structures:

file.buffer[];
Buffer used for reading and writing SD-card sectors.
Variables:
file.buffer[0-511]:  Byte-array to hold one sector of data.

file.MBR;
Master Boot Record of the SD card.
Variables:
Part1Type:  Partition1 Type. Only types 0×04, 0×06 and 0×86 can be used.
part1Start: First sector of Partition1.
part1Size:  Number of sectors in Partition1.

file.BS;
Boot Sector of Partition1.
Variables:

sectorsPerCluster:   Number of sectors per cluster.
reservedSectors:   Number of reserved sectors.
fatCopies:   Number of File Allocation Tables in partition.  Almost always 2.
rootDirectoryEntries:   Maximum number of root directory entries.
totalFilesystemSectors:   Total number of sectors available to the file system.
sectorsPerFAT:   Sectors per File Allocation Table.
hiddenSectors:   Number of hidden sectors preceding the partition that contains this FAT volume.
partitionSerialNum:   Partition serial number.
fat1Start:   First sector of primary File Allocation Table.
fat2Start :   First sector of secondary File Allocation Table.
partitionSize:   Size of partition in MB.

file.DE;
Directory Entry structure. Used by findFirstFile() and findNextFile().
Variables:

filename:   Char array containing the file’s name.
fileext:   Char array containing the file’s extension.
attributes:   File attributes.
time:   File creation time (encoded).
date:   File creation date (encoded).
startCluster:   First cluster of file data.
fileSize:   File size in bytes.

Functions:

file.initFAT(spispeed) : Initialize the interface, and connect to the SD card.

file.findFirstFile(DEstruct) : Find information about the first file in the root directory.

file.findNextFile(DEstruct) : Find information about the next file in the root directory.

file.openFile(filename, filemode) : Open a file for reading.

file.readBinary() : Read the next sector of an open binary file.

file.readLn(buffer, bufSize) : Read the next line of text from an open text-file.

file.writeLn(text) : Append a line of text to a text-file.

file.closeFile() : Close the currently open file.

file.exists(filename) : Check if a file exists.

file.rename(from-name, to-name) : Rename a file.

file.delFile(filename) : Delete a file.

file.create(filename) : Create a new, empty file.
41  Community / Products and Services / 4X4 Key-pad shield with 5110 LCD display interface on: February 27, 2011, 09:45:13 am
It's a sample 4X4 key-pad shield with a 5110 Graphic LCD interface. Just plug it on Arduino directly, you get the small development platform with keypad input and Graphic LCD display.


This KeyPad shield use 8 digital pins to do the rows and columns scanning, and it support 16 buttons.With this Keypad, your project will become easier to control.


In the shield we put a 8pin interface for the 5110 Graphic  LCD, it should be the most cost-effective display module for small project or handheld device.


More information about this shield , you can download the datasheet there and the demo code : http://iteadstudio.com/store/index.php?main_page=product_info&cPath=18&products_id=308&zenid=hpi43i1spt6auvp3roehhs9up0

42  Forum 2005-2010 (read only) / Development / Re: Arduino control the 2.4" TFT LCD on: May 31, 2010, 10:55:31 am
Update :
now we release a library for the 2.4"LCD module , now the beta version just support the LCD display and not powerful enough ,the V1.0 will include more GUI functions and will support touch screen.

Google Code project :
http://code.google.com/p/itdb02
43  Forum 2005-2010 (read only) / Development / Re: Arduino control the 2.4' TFT LCD on: May 10, 2010, 09:12:56 pm
Quote
The fact that is uses up every I/O pin on a standard Arduino kind of limits it's application doesn't it?  

Plan on using a Mega board if you are going to the trouble of gifwriting a library for it, otherwise it's kind of useless, no?
Arduino really with a pool resources of I/O .. so 16bit will use up all the pins of Arduino , if you want to use the touch and the SD card , then just can choose the 8bit mode -- which more slower than you can imagine  smiley-sad Mega has enough I/O for the LCD ,touch , SDcard even the external flash .

Even in the 16bit mode work in 16M , the refresh rate is not faster than 1 frame per second ... so you can used the arduino to show the UI menu or a static image , but the video beyond its capacity -- STM32 is a good choice, I like the DMA smiley-wink

Code:
#define LCD_RS 8        
#define LCD_WR 9      
#define LCD_CS 10      
#define LCD_REST 11


void LCD_Writ_Bus(char VH,char VL)  
{  
    unsigned char i,temp,data;
    data=VH;
     for(i=0;i<8;i++)
    {
       temp=(data&0x01);
       if(temp)
       digitalWrite(i,HIGH);
       else
       digitalWrite(i,LOW);
       data=data>>1;
    }
    digitalWrite(LCD_WR,LOW);
    digitalWrite(LCD_WR,HIGH);
    data=VL;
    for(i=0;i<8;i++)
    {
       temp=(data&0x01);
       if(temp)
       digitalWrite(i,HIGH);
       else
       digitalWrite(i,LOW);
       data=data>>1;
    }            
    digitalWrite(LCD_WR,LOW);
    digitalWrite(LCD_WR,HIGH);
}


void LCD_Write_COM(char VH,char VL)  
{  
    digitalWrite(LCD_RS,LOW);
    LCD_Writ_Bus(VH,VL);
}


void LCD_Write_DATA(char VH,char VL)    
{
    digitalWrite(LCD_RS,HIGH);
    LCD_Writ_Bus(VH,VL);
}

void Address_set(unsigned int x1,unsigned int y1,unsigned int x2,unsigned int y2)
{
    LCD_Write_COM(0x00,0x20);LCD_Write_DATA(x1>>8,x1);    
    LCD_Write_COM(0x00,0x21);LCD_Write_DATA(y1>>8,y1);  
    LCD_Write_COM(0x00,0x50);LCD_Write_DATA(x1>>8,x1);  
    LCD_Write_COM(0x00,0x52);LCD_Write_DATA(y1>>8,y1);  
    LCD_Write_COM(0x00,0x51);LCD_Write_DATA(x2>>8,x2);  
    LCD_Write_COM(0x00,0x53);LCD_Write_DATA(y2>>8,y2);  
    LCD_Write_COM(0x00,0x22);                                   
}

void LCD_Init(void)
{

    digitalWrite(LCD_REST,HIGH);
    delay(5);
    digitalWrite(LCD_REST,LOW);
    delay(5);
    digitalWrite(LCD_REST,HIGH);
    delay(5);

    digitalWrite(LCD_CS,LOW);  
    //************* Start Initial Sequence **********//
    LCD_Write_COM(0x00,0xE5); LCD_Write_DATA(0x78,0xF0); // set SRAM internal timing
    LCD_Write_COM(0x00,0x01); LCD_Write_DATA(0x01,0x00); // set SS and SM bit
    LCD_Write_COM(0x00,0x02); LCD_Write_DATA(0x07,0x00); // set 1 line inversion
    LCD_Write_COM(0x00,0x03); LCD_Write_DATA(0x10,0x30); // set GRAM write direction and BGR=1.
    LCD_Write_COM(0x00,0x04); LCD_Write_DATA(0x00,0x00); // Resize register
    LCD_Write_COM(0x00,0x08); LCD_Write_DATA(0x02,0x07); // set the back porch and front porch
    LCD_Write_COM(0x00,0x09); LCD_Write_DATA(0x00,0x00); // set non-display area refresh cycle ISC[3:0]
    LCD_Write_COM(0x00,0x0A); LCD_Write_DATA(0x00,0x00); // FMARK function
    LCD_Write_COM(0x00,0x0C); LCD_Write_DATA(0x00,0x00); // RGB interface setting
    LCD_Write_COM(0x00,0x0D); LCD_Write_DATA(0x00,0x00); // Frame marker Position
    LCD_Write_COM(0x00,0x0F); LCD_Write_DATA(0x00,0x00); // RGB interface polarity
    //*************Power On sequence ****************//
    LCD_Write_COM(0x00,0x10); LCD_Write_DATA(0x00,0x00); // SAP, BT[3:0], AP, DSTB, SLP, STB
    LCD_Write_COM(0x00,0x11); LCD_Write_DATA(0x00,0x07); // DC1[2:0], DC0[2:0], VC[2:0]
    LCD_Write_COM(0x00,0x12); LCD_Write_DATA(0x00,0x00); // VREG1OUT voltage
    LCD_Write_COM(0x00,0x13); LCD_Write_DATA(0x00,0x00); // VDV[4:0] for VCOM amplitude
    LCD_Write_COM(0x00,0x07); LCD_Write_DATA(0x00,0x01);
    delay(50); // Dis-charge capacitor power voltage
    LCD_Write_COM(0x00,0x10); LCD_Write_DATA(0x10,0x90); // 1490//SAP, BT[3:0], AP, DSTB, SLP, STB
    LCD_Write_COM(0x00,0x11); LCD_Write_DATA(0x02,0x27); // DC1[2:0], DC0[2:0], VC[2:0]
    delay(50); // Delay 50ms
    LCD_Write_COM(0x00,0x12); LCD_Write_DATA(0x00,0x1F); //001C// Internal reference voltage= Vci;
    delay(50); // Delay 50ms
    LCD_Write_COM(0x00,0x13); LCD_Write_DATA(0x15,0x00); //0x1000//1400   Set VDV[4:0] for VCOM amplitude  1A00
    LCD_Write_COM(0x00,0x29); LCD_Write_DATA(0x00,0x27); //0x0012 //001a  Set VCM[5:0] for VCOMH  //0x0025  0034
    LCD_Write_COM(0x00,0x2B); LCD_Write_DATA(0x00,0x0D); // Set Frame Rate   000C
    delay(50); // Delay 50ms
    LCD_Write_COM(0x00,0x20); LCD_Write_DATA(0x00,0x00); // GRAM horizontal Address
    LCD_Write_COM(0x00,0x21); LCD_Write_DATA(0x00,0x00); // GRAM Vertical Address
    // ----------- Adjust the Gamma Curve ----------//
    LCD_Write_COM(0x00,0x30); LCD_Write_DATA(0x00,0x00);
    LCD_Write_COM(0x00,0x31); LCD_Write_DATA(0x07,0x07);
    LCD_Write_COM(0x00,0x32); LCD_Write_DATA(0x03,0x07);
    LCD_Write_COM(0x00,0x35); LCD_Write_DATA(0x02,0x00);
    LCD_Write_COM(0x00,0x36); LCD_Write_DATA(0x00,0x08);//0207
    LCD_Write_COM(0x00,0x37); LCD_Write_DATA(0x00,0x04);//0306
    LCD_Write_COM(0x00,0x38); LCD_Write_DATA(0x00,0x00);//0102
    LCD_Write_COM(0x00,0x39); LCD_Write_DATA(0x07,0x07);//0707
    LCD_Write_COM(0x00,0x3C); LCD_Write_DATA(0x00,0x02);//0702
    LCD_Write_COM(0x00,0x3D); LCD_Write_DATA(0x1D,0x04);//1604
    
    //------------------ Set GRAM area ---------------//
    LCD_Write_COM(0x00,0x50); LCD_Write_DATA(0x00,0x00); // Horizontal GRAM Start Address
    LCD_Write_COM(0x00,0x51); LCD_Write_DATA(0x00,0xEF); // Horizontal GRAM End Address
    LCD_Write_COM(0x00,0x52); LCD_Write_DATA(0x00,0x00); // Vertical GRAM Start Address
    LCD_Write_COM(0x00,0x53); LCD_Write_DATA(0x01,0x3F); // Vertical GRAM Start Address
    LCD_Write_COM(0x00,0x60); LCD_Write_DATA(0xA7,0x00); // Gate Scan Line
    LCD_Write_COM(0x00,0x61); LCD_Write_DATA(0x00,0x01); // NDL,VLE, REV
    LCD_Write_COM(0x00,0x6A); LCD_Write_DATA(0x00,0x00); // set scrolling line
    //-------------- Partial Display Control ---------//
    LCD_Write_COM(0x00,0x80); LCD_Write_DATA(0x00,0x00);
    LCD_Write_COM(0x00,0x81); LCD_Write_DATA(0x00,0x00);
    LCD_Write_COM(0x00,0x82); LCD_Write_DATA(0x00,0x00);
    LCD_Write_COM(0x00,0x83); LCD_Write_DATA(0x00,0x00);
    LCD_Write_COM(0x00,0x84); LCD_Write_DATA(0x00,0x00);
    LCD_Write_COM(0x00,0x85); LCD_Write_DATA(0x00,0x00);
    //-------------- Panel Control -------------------//
    LCD_Write_COM(0x00,0x90); LCD_Write_DATA(0x00,0x10);
    LCD_Write_COM(0x00,0x92); LCD_Write_DATA(0x06,0x00);
    LCD_Write_COM(0x00,0x07); LCD_Write_DATA(0x01,0x33); // 262K color and display ON
    digitalWrite(LCD_CS,HIGH);  

}

void Pant(char VH,char VL)
{
    int i,j;
    digitalWrite(LCD_CS,LOW);
    Address_set(0,0,240,320);
    for(i=0;i<320;i++)
     {
      for (j=0;j<240;j++)
             {
             LCD_Write_DATA(VH,VL);
        }

      }
     digitalWrite(LCD_CS,HIGH);  
}

void setup()
{
  unsigned char p;
  int i,j,k;
  for(p=0;p<20;p++)
  {
    pinMode(p,OUTPUT);
  }
  
    LCD_Init();          
                                                  
    
}

void loop()
{
   Pant(0xf8,0x00);
   delay(1000);
   Pant(0x07,0xE0);
   delay(1000);
   Pant(0x00,0x1f);
   delay(1000);
  
}

The code for 8 bit mode~ connect the DB9-DB16 to the Arduino D0-D7 . pull the DB1-DB8 to GND.

The same effect as the 16bit mode , but slower than 16bit mode , if you use the 8M 3.3V Arduino Pro , about 3 seconds one frame.... but now you have the pins for SD card and the Touch.

44  Forum 2005-2010 (read only) / Development / Re: Arduino control the 2.4' TFT LCD on: May 10, 2010, 09:05:49 pm
Quote
Rats. Going by the thread title, I was hoping to find a LARGE TFT that I could use in a  project.

It's a Low-level errors... 2.4“ GLCD  smiley-wink
45  Forum 2005-2010 (read only) / Development / Arduino control the 2.4" TFT LCD on: May 10, 2010, 11:56:34 am
Useing the 2.4 inch TFT LCD , which is used ILI9325 controller ,  65K color , 320*240 (resolution).

Connect the pins to Arduino
DB0-DB16 to pin D0-D13 , pin A0-A1 of Arduino
RESET to A2
CS to A3
WR to A4
RS to A5

Use the 16 bit data bus which is 2 timer faster than 8 bit. but it used up all the pins of the Arduino.
Code:
#define LCD_RS 19
#define LCD_REST 16
#define LCD_WR 18
#define LCD_CS 17
 
void main_Write_COM(int DH)
{
  unsigned char i;
  int temp;
  digitalWrite(LCD_RS,LOW);
  digitalWrite(LCD_CS,LOW);
  for(i=0;i&lt;16;i++)
  {
    temp=(DH&amp;0x01);
    if(temp)
      digitalWrite(i,HIGH);
    else
      digitalWrite(i,LOW);
    DH=DH&gt;&gt;1;
  }
  digitalWrite(LCD_WR,LOW);
  digitalWrite(LCD_WR,HIGH);
  digitalWrite(LCD_CS,HIGH);
}
 
void main_Write_DATA(int DH)
{
  unsigned char i;
  int temp;
  digitalWrite(LCD_RS,HIGH);
  digitalWrite(LCD_CS,LOW);
  for(i=0;&lt;16;i++)
  {
    temp=(DH&amp;;0x01);
    if(temp)
      digitalWrite(i,HIGH);
    else
      digitalWrite(i,LOW);
    DH=DH&gt;&gt;1;
  }
  digitalWrite(LCD_WR,LOW);
  digitalWrite(LCD_WR,HIGH);
  digitalWrite(LCD_CS,HIGH);
}
 
void main_W_com_data(int com1,int dat1)
{
  main_Write_COM(com1);
  main_Write_DATA(dat1);
}
 
void address_set(unsigned int x1,unsigned int y1,unsigned int x2,unsigned int y2)
{
  main_W_com_data(0x0002,x1&gt;&gt;8);     // Column address start2
  main_W_com_data(0x0003,x1);    // Column address start1
  main_W_com_data(0x0004,x2&gt;&gt;8);     // Column address end2
  main_W_com_data(0x0005,x2);    // Column address end1
  main_W_com_data(0x0006,y1&gt;&gt;8);     // Row address start2
  main_W_com_data(0x0007,y1);    // Row address start1
  main_W_com_data(0x0008,y2&gt;&gt;8);     // Row address end2
  main_W_com_data(0x0009,y2);    // Row address end1
  main_Write_COM(0x0022);      
 
}
 
void main_init(void)
{
 
  digitalWrite(LCD_REST,HIGH);
  delay(5);
  digitalWrite(LCD_REST,LOW);
  delay(10);
  digitalWrite(LCD_REST,HIGH);
  delay(20);
 
  //  VENDOR
  main_W_com_data(0x0046,0x00A4);
  main_W_com_data(0x0047,0x0053);
  main_W_com_data(0x0048,0x0000);
  main_W_com_data(0x0049,0x0044);
  main_W_com_data(0x004a,0x0004);
  main_W_com_data(0x004b,0x0067);
  main_W_com_data(0x004c,0x0033);
  main_W_com_data(0x004d,0x0077);
  main_W_com_data(0x004e,0x0012);
  main_W_com_data(0x004f,0x004C);
  main_W_com_data(0x0050,0x0046);
  main_W_com_data(0x0051,0x0044);
 
  //240x320 window setting
  main_W_com_data(0x0002,0x0000); // Column address start2
  main_W_com_data(0x0003,0x0000); // Column address start1
  main_W_com_data(0x0004,0x0000); // Column address end2
  main_W_com_data(0x0005,0x00ef); // Column address end1
  main_W_com_data(0x0006,0x0000); // Row address start2
  main_W_com_data(0x0007,0x0000); // Row address start1
  main_W_com_data(0x0008,0x0001); // Row address end2
  main_W_com_data(0x0009,0x003f); // Row address end1
 
  // Display Setting
  main_W_com_data(0x0001,0x0006); // IDMON=0, INVON=1, NORON=1, PTLON=0
  main_W_com_data(0x0016,0x00C8); // MY=0, MX=0, MV=0, ML=1, BGR=0, TEON=0   0048
  main_W_com_data(0x0023,0x0095); // N_DC=1001 0101
  main_W_com_data(0x0024,0x0095); // PI_DC=1001 0101
  main_W_com_data(0x0025,0x00FF); // I_DC=1111 1111
 
  main_W_com_data(0x0027,0x0002); // N_BP=0000 0010
  main_W_com_data(0x0028,0x0002); // N_FP=0000 0010
  main_W_com_data(0x0029,0x0002); // PI_BP=0000 0010
  main_W_com_data(0x002a,0x0002); // PI_FP=0000 0010
  main_W_com_data(0x002C,0x0002); // I_BP=0000 0010
  main_W_com_data(0x002d,0x0002); // I_FP=0000 0010
 
  main_W_com_data(0x003a,0x0001); // N_RTN=0000, N_NW=001    0001
  main_W_com_data(0x003b,0x0000); // P_RTN=0000, P_NW=001
  main_W_com_data(0x003c,0x00f0); // I_RTN=1111, I_NW=000
  main_W_com_data(0x003d,0x0000); // DIV=00
  delay(1);
  main_W_com_data(0x0035,0x0038); // EQS=38h
  main_W_com_data(0x0036,0x0078); // EQP=78h
  main_W_com_data(0x003E,0x0038); // SON=38h
  main_W_com_data(0x0040,0x000F); // GDON=0Fh
  main_W_com_data(0x0041,0x00F0); // GDOFF
 
  // Power Supply Setting
  main_W_com_data(0x0019,0x0049); // CADJ=0100, CUADJ=100, OSD_EN=1 ,60Hz
  main_W_com_data(0x0093,0x000F); // RADJ=1111, 100%
  delay(1);
  main_W_com_data(0x0020,0x0040); // BT=0100
  main_W_com_data(0x001D,0x0007); // VC1=111   0007
  main_W_com_data(0x001E,0x0000); // VC3=000
  main_W_com_data(0x001F,0x0004); // VRH=0011
 
  //VCOM SETTING
  main_W_com_data(0x0044,0x004D); // VCM=101 0000  4D
  main_W_com_data(0x0045,0x000E); // VDV=1 0001   0011
  delay(1);
  main_W_com_data(0x001C,0x0004); // AP=100
  delay(2);
 
  main_W_com_data(0x001B,0x0018); // GASENB=0, PON=0, DK=1, XDK=0, VLCD_TRI=0, STB=0
  delay(1);
  main_W_com_data(0x001B,0x0010); // GASENB=0, PON=1, DK=0, XDK=0, VLCD_TRI=0, STB=0
  delay(1);
  main_W_com_data(0x0043,0x0080); //set VCOMG=1
  delay(2);
 
  // Display ON Setting
  main_W_com_data(0x0090,0x007F); // SAP=0111 1111
  main_W_com_data(0x0026,0x0004); //GON=0, DTE=0, D=01
  delay(1);
  main_W_com_data(0x0026,0x0024); //GON=1, DTE=0, D=01
  main_W_com_data(0x0026,0x002C); //GON=1, DTE=0, D=11
  delay(1);
  main_W_com_data(0x0026,0x003C); //GON=1, DTE=1, D=11
 
  // INTERNAL REGISTER SETTING
  main_W_com_data(0x0057,0x0002); // TEST_Mode=1: into TEST mode
  main_W_com_data(0x0095,0x0001); // SET DISPLAY CLOCK AND PUMPING CLOCK TO SYNCHRONIZE
  main_W_com_data(0x0057,0x0000); // TEST_Mode=0: exit TEST mode
  //main_W_com_data(0x0021,0x0000);
  main_Write_COM(0x0022);  
 
}
 
void Pant(unsigned int color)
{
  int i,j;
  address_set(0,0,239,319);
 
  for(i=0;i&lt;320;i++)
  {
    for (j=0;j&lt;240;j++)
    {
      main_Write_DATA(color);
    }
 
  }
}
 
void setup()
{
  unsigned char p;
  for(p=0;p&lt;20;p++)
  {
    pinMode(p,OUTPUT);
  }
  main_init();
}
 
void loop()
{
  Pant(0xf800); //Red
  delay(1000);
  Pant(0X07E0); //Green
  delay(1000);
  Pant(0x001f); //Blue
  delay(1000);
}



More information about the demo code and the screen :
http://iteadstudio.com/application-note/itdb02-2-4-display-with-arduino

I am going to write a library for this controller , and there are the 2.4 and 3.2 inch LCD use the same controller that can use this library smiley-wink
Pages: 1 2 [3] 4 5