Show Posts
Pages: 1 2 3 [4] 5
46  Forum 2005-2010 (read only) / Development / Re: Library for Ultrasonic Ranging Module HC-SR04 on: April 25, 2010, 01:40:37 am
can not post the post with img before post the normal one ... so ...
reply and show the picture and attach the library

Download the library here



47  Forum 2005-2010 (read only) / Development / Library for Ultrasonic Ranging Module HC-SR04 on: April 25, 2010, 01:37:05 am
This library is for the HC-SR04 ultrasonic ranging module . The module is very easy use , now with the library , user just need a function then he can get the distance .

Library includes 3 functions for user :

Ultrasonic(int TP, int EP)

This is a initial function for ultrasonic ranging module, choose the pins for module Trig and Echo pin. You need using this function before Setup() to define the pin map.
example: Ultrasonic(13,12);
then you define the digital pin 13 of Arduino for the Trig pin of HC-SR04. And the pin 12 for Echo pin.


long Timing()

Trigger the ultrasonic ranging module work and return the duration that Echo pin keep high level.
example: long time; Ultrasonic hcsr; time = hcsr.Timing();
Then you start the HC-SR04 for ranging and you get the time the Echo pin keep high, you can change the time corresponds to the distance : Distance = ((Duration of high level)*(Sonic :340m/s))/2

long Ranging(int sys)

If you don't want to change the time into distance yourself  , this function will help you get the distance immediate. And the function has a parameter sys, you can use CM or ICN , than you get the distance show as centimeter or inch. This function will call the Timing() and you don't need to use the Timing() before it.
example: long distance; Ultrasonic hcsr; distance = hcsr.Ranging(CM);

 smiley-wink Hope it help.

48  Forum 2005-2010 (read only) / Development / Arduino control AD7843 to achieve handwriting on: May 26, 2010, 12:04:54 pm

AD7843 use the SPI mode interface to read and write data:
Code:
void spistar()                                     //SPI Start
{
  digitalWrite(CS,HIGH);
  digitalWrite(DCLK,HIGH);
  digitalWrite(DIN,HIGH);
  digitalWrite(DCLK,HIGH);

}
Code:
void WriteCharTo7843(unsigned char num)          //SPI Write Data
{
  unsigned char count=0;
  unsigned char temp;
  unsigned nop;
  temp=num;
  digitalWrite(DCLK,LOW);
  for(count=0;count<8;count++)
  {
    if(temp&0x80)
      digitalWrite(DIN,HIGH);
    else
      digitalWrite(DIN,LOW);

    temp=temp<<1;

    digitalWrite(DCLK,LOW);                
    nop++;
    nop++;
    digitalWrite(DCLK,HIGH);
    nop++;
    nop++;
  }
}
Code:
unsigned int ReadFromCharFrom7843()             //SPI Read Data
{
  unsigned nop;
  unsigned char count=0;
  unsigned int Num=0;
  for(count=0;count<12;count++)
  {
    Num<<=1;
    digitalWrite(DCLK,HIGH);              
    nop++;
    digitalWrite(DCLK,LOW);
    nop++;
    if(digitalRead(DOUT)) Num++;
  }
  return(Num);
}

Code:
void AD7843(void)              
{
  digitalWrite(CS,LOW);                    
  WriteCharTo7843(0x90);        
  digitalWrite(DCLK,HIGH);
  digitalWrite(DCLK,LOW);
  TP_Y=ReadFromCharFrom7843();
  WriteCharTo7843(0xD0);      
  digitalWrite(DCLK,HIGH);
  digitalWrite(DCLK,LOW);
  TP_X=ReadFromCharFrom7843();
  digitalWrite(CS,HIGH);
}
Code:
void loop()
{
  unsigned char flag;
  unsigned char ss[6];      
  unsigned int lx,ly;
  spistar();  

  while(1)
  {
    flag = digitalRead(IRQ);
    if (flag == 0)
    {        
      digitalWrite(LCD_CS,LOW);
      AD7843();
      lx=240-((TP_X-220)/16);
      ly=320-((TP_Y-400)/11);
      Address_set(lx,ly,lx+2,ly+2);
      LCD_Write_DATA(0,255);
      LCD_Write_DATA(0,255);
      LCD_Write_DATA(0,255);
      LCD_Write_DATA(0,255);
      LCD_Write_DATA(0,255);
      LCD_Write_DATA(0,255);
      LCD_Write_DATA(0,255);
      LCD_Write_DATA(0,255);
      LCD_Write_DATA(0,255);
      digitalWrite(LCD_CS,HIGH);
    }

  }

}

Display code is the same as ILI9325 demo.

Download whole demo project here:
http://iteadstudio.com/application-note/itdb02-touch-screen-handwrite-demo

 smiley-sad  The touch screen resolving capability is not as high as I though. But enough for menu selection location...  
49  Forum 2005-2010 (read only) / Development / Re: LCD Touch screen and SD card expand shield on: July 11, 2010, 09:28:48 am
http://www.henningkarlsen.com/electronics/a_l_itdb02_graph.php

A new library with more display functions , by Henning Karlsen.
50  Forum 2005-2010 (read only) / Development / Re: LCD Touch screen and SD card expand shield on: July 05, 2010, 06:00:17 am
 smiley-wink I really have post a topic in the software forum for the code of this screen .

I will go on update the library , the new version will add the SD card function .

BTW, there are some customer who bought the LCD module response that the External Falsh is not useful , so we designed to change the External Falsh (not solder)to a DS1307 RTC (solder)  ;D Then the LCD module should be one more function than now.

Alex
51  Forum 2005-2010 (read only) / Development / LCD Touch screen and SD card expand shield on: July 05, 2010, 02:07:22 am


The ITDB02 shield is a LCD + touch + SD CARD expand shield , it compatible with a 2.4"/3.2" 320*240 65K colors LCD module - ITDB02.
Because the Arduino the I/O limited resources, so you just can choose 16bit mode display,8bit with touch or 8bit with SD card, we will build a new version for Mega and then it will be enough resources for all function at the same time.



There is a Arduino library compatible for it : http://code.google.com/p/itdb02
Now the v1.1 library just support Display and Touch function ,the new version will add the SD card function.

TDB02 is a powerful LCD breakout module , it has a 2.4"/3.2" TFT LCD and touch screen , SD card socket.

We will release a library for ITDB02 , the library will include the LCD display function , touch function, and the SD Card read/write function.

Now we have release the first version library for arduino. This version just provide the LCD display functions and touch functions , without SD Card support yet , but we will update the new version to fill with more functions and fix the bugs soon.

We hope everyone who try using this library can give us your suggestion , any advice will be appreciated and help developing the library.

ITDB02(int D8, int D9,int D10, int D11,int D12, int D13,int D14, int D15,int RS, int WR,int CS, int RST)
Enumerating function , define a new class of ITDB02 and assign the pins for the object. Here you can define a LCD [ch146]s pins out - for 8 bit mode.

ITDB02(int D0, int D1,int D2, int D3,int D4, int D5,int D6, int D7,int D8, int D9,int D10, int D11,int D12, int D13,int D14, int D15, int RS, int WR,int CS, int RST)
Enumerating function , define a new class of ITDB02 and assign the pins for the object. Here you can define a LCD 's pins out - for 16 bit mode.

CleanLCD()
Clean the LCD , plan all the LCD with white color.

void Initial()
Used in setup() loop , for initial screen settings.

Pant(int sx, int sy, int ex, int ey, int col)
Fill a area with one color , using the sx , sy , ex , ey to set the color area , and the col is the color value.

Setcolor(int FC,int BC)
Set the foreground color and background color . It's usually used before show char or string.

Dispshowchar(int x, int y, char val)
Show a char in the specified location.

Dispshowstr(int x,int y, char @st)
Show the string , x, y is the start position .

Drawdot(int x, int y)
Draw a 9 pixes dot in the LCD.

Touchpin(int tclk,int tcs,int tdin,int dout, int irq)
Assign pins for touch controller.

TouchInitial()
Start SPI.

TouchGetaddress()
Read the address from the touch controller register. The address will be put in the TP-X and TP-Y global variables.

TouchGetX()
Change the TP-X to the coordinate in LCD.

TouchGetY()
Change the TP-Y to the coordinate in LCD.

TouchIRQ()
Determine whether there is touch interrupt.

The library include 3 examples  about display and touch , they are compatible with ITDB02 shield v1.2, you can download the Manual of the shield here.


More latest information : http://iteadstudio.com
52  Forum 2005-2010 (read only) / Development / Re: A8 - A10? on: July 31, 2010, 12:06:14 pm
 :-[ It's really a typo on the prototype  .. These 3 pins should be D9 D10 D11.  "A10-A8" just the net we named that in the schematic but not the pin name.

We have fixed it with right silk-screen in the new board. More detailed for these pins will be included in the new manual.
53  Forum 2005-2010 (read only) / Development / Re: ATMEGA328P-20AU on: July 22, 2010, 05:13:40 am
mouser  ;D
54  Forum 2005-2010 (read only) / Development / Re: ATMEGA328P-20AU on: July 22, 2010, 01:18:02 am
I just found the ATMega328P-PU at the market [ch65292] but the different price at different times , even purchase form the same suppliers
55  Forum 2005-2010 (read only) / Development / Re: Help with Arduino Clock... on: July 01, 2010, 11:54:38 pm
what about using the DS1307 Real time clock (RTC) chip.

Search the Arduino+DS1307 you can find a lot of post with code even the library. ;D
56  Forum 2005-2010 (read only) / Development / Re: Help getting the FTDI to talk to atmega168. on: July 01, 2010, 08:22:36 pm
I found that you connect the 2nd and 3th pin together ?  I think you should connect the 2nd pin (DTR#) to the RESET of the ATmega with a capacitor, and leave the 3th pin(RTS) alone.
57  Forum 2005-2010 (read only) / Development / Re: Iteaduino: derivative and improve from Arduino on: July 01, 2010, 12:26:07 am
That's right , 328 is in our plans   smiley-wink now the Iteaduino with 328P in stock . But the price will expensive than 168P.

168 is not so powerful as 328, however, in many cases it has to meet requirements of your project .So it still has the value of existing ;D

More information : http://iteadstudio.com
58  Forum 2005-2010 (read only) / Development / Re: Iteaduino: derivative and improve from Arduino on: June 30, 2010, 10:16:19 am
As the datasheet of ATMega168P / 328P : 0 - 10 MHz @ 2.7 - 5.5V, 0 - 20 MHz @ 4.5 - 5.5V

so if work with internal 8M , it all OK for both 3V3 and 5V .

See the Maximum Frequency vs. VCC graph

When it work in 16M now , it's dangerous ,but don't worry ,on most  circumstances it's OK ;D


I admit it's irregular to let the 168 work with 3V3 at 16M, but it's a optional[ch65292] you can choose working with 5V -- but when you meet the 3.3V module but not a voltage regular shield in hand , may be a 3.3V optional is a good choice  smiley-wink.


59  Forum 2005-2010 (read only) / Development / Iteaduino: derivative and improve from Arduino on: June 30, 2010, 09:08:04 am
When I use the Arduino board, there is one thing always trouble me, its I/O voltage level is 5V and it's not compatible with many 3.3V module like ITDB02 LCD and nRF24L01 2.4G wireless module.  And if you want to connect the Arduino with a sensor or a servo , you need a expand shield like sensor shield V4, but I consider it still has enough space for these interfaces on the board , so I make a iteaduino which is an Arduino compatible board. It's designed is basing on Duemilanove scheme, 100% compatible to its existing program, shield and IDE. On the hardware part, remarkable changes are taken to improve the flexibility and user experience we referred to.

And we move the reset button and LEDs to the edge of the board, so it will not be covered again when put the shield above the Arduino.

A 1117-3.3 voltage is added to make a more powerful 3.3V power supply -- Arduino's 3.3V from FT232 is not enough for some module,like GPRS module.



Basic features

  • Inherits all of Arduino Duemilanove' s features.
  • Compatible to Duemilanove's pin layout, screw hole and dimensions.
  • 3.3V Operating Voltage selection
  • More visible location of Indicator LEDs
  • Pin out for Sensor and Servo




What are the changes from Arduino to iteaduino:

1.      More powerful 3.3V power supply
2.      3.3V Operating Voltage selection
3.      Easier access to reset button
4.      More visible location for LEDs
5.      Sensor and Servo interface break out
6.      Re-route PCB




Download the schematic here
Download the Manual here

There may be still some inadequate on this board, any suggestion is appreciated.
60  Forum 2005-2010 (read only) / Exhibition / Re: $10 Arduino on: July 23, 2010, 05:19:35 am
It more like a arduino : http://metalab.at/wiki/Metaboard

Guess its price...$10
Pages: 1 2 3 [4] 5