Show Posts
|
|
Pages: [1] 2 3 4
|
|
1
|
Using Arduino / Displays / Re: LCD contrast not working
|
on: February 24, 2012, 06:48:09 am
|
|
JHD16A it is working with arduino duemilanove. Please check: 1 (VSS) GND Arduino pin* 2 (VDD) + 5v Arduino pin 3 (contrast) Resistor(2K) to GND Arduino pin* pin13|---/\/\/\/-------ArduinoGND 4 RS Arduino pin 12 5 R/W Arduino pin 11 6 Enable Arduino pin 10 7 No connection 8 No connection 9 No connection 10 No connection 11 Data 4 Arduino pin 5 12 Data 5 Arduino pin 4 13 Data 6 Arduino pin 3 14 Data 7 Arduino pin 2 15 Backlight + 5v Arduino pin 16 Backlight GND GND Arduino pin*
|
|
|
|
|
3
|
Using Arduino / Programming Questions / Re: Help with Strings and Extracting Data.
|
on: February 23, 2012, 02:43:05 am
|
//*buffer="AT+CSQ: 12,0" expected buufer format // return -1 when any error // non zero is voltage level int getVoltageLev(char *buffer) { char *tmpBuf; char *cpt; char *cpt2; tmpBuf=malloc(strlen(buffer)+1); if(tmpBuf) //allocated the buffer { strcpy( tmpBuf,buffer); //copy required because this buffer manipulation to be required cpt=strstr(tmpBuf,": "); if(cpt!=NULL) //cpt= ": 12,0" { cpt+=2; //cpt= "12,0" cpt2=cpt; //cpt2= "12,0" cpt2=strstr(cpt2,",");//cpt2= ",0" if(cpt2!=NULL) { *cpt2='\0'; //cpt2= ",0" <--------Replace , with string terminator //cpt=12 //LcdStringCopy(0,12,cpt,3); return(atoi(cpt)); //return the parse value } } free(tmpBuf); } return -1; //Invalid value or Error }
I have tested the simillar function for AT+CBC for charge level, this module for AT+CSQ
|
|
|
|
|
4
|
Using Arduino / Programming Questions / Re: char msg[] versus const char text[]
|
on: February 23, 2012, 12:18:45 am
|
HT1632.drawText((const char *)msg[z], x, y, FONT_5X7, FONT_5X7_WIDTH, FONT_5X7_HEIGHT, FONT_5X7_STEP_GLYPH); //msg[z] <--------------------- Is hold a Value not the address //(const char *)msg[z] <--------------- you are converting a value to address // (const char *)&msg[z] <--------------- correct syntax you are converting the address to a (const char *)
|
|
|
|
|
5
|
Using Arduino / Programming Questions / Re: char msg[] versus const char text[]
|
on: February 22, 2012, 06:20:56 am
|
Function prototype is : void drawText(const char [], int x, int y, const char font [], const char font_width [], char font_height, int font_glyph_step, char gutter_space = 1);
HT1632.drawText(val, x, y, FONT_5X7, FONT_5X7_W, FONT_5X7_H, FONT_5X7_STEP); I have Tested (val, x, y,------------> do not have syntax error can you check the types or constants in header files HT1632.h FONT_5X7, FONT_5X7_W, FONT_5X7_H, FONT_5X7_STEP
|
|
|
|
|
9
|
Using Arduino / Programming Questions / Re: An Issue with interrupts
|
on: February 17, 2012, 02:58:46 am
|
First check your Input is changing state or not through this code //##################### TEST INPUT PIN2 ######################### void setup() { Serial.begin(9600); pinMode(2, INPUT); }
void loop() { int sensorValue = digitalRead(2); Serial.println(sensorValue, DEC); }
//##################### TEST INPUT PIN3 ######################### void setup() { Serial.begin(9600); pinMode(3, INPUT); }
void loop() { int sensorValue = digitalRead(3); Serial.println(sensorValue, DEC); }
|
|
|
|
|
13
|
Using Arduino / Networking, Protocols, and Devices / Re: Interfacing with garage door remote
|
on: February 09, 2012, 07:23:38 am
|
The link is: http://hkdaylightrf.en.alibaba.com
//Arduino PIN DL-R02EF PIN DESCRIPTION // 2<-----------> VT for interrupt pin // 7<----------->D3 // 8<----------->D2 // 9<----------->D1 // 10<---------->D0 int pbIn = 0; // Interrupt 0 is on DIGITAL PIN 2! int addr0=0; int addr1=0; int addr2=0; int addr3=0; int d7=0,d8=0,d9=0,d10=0; int rfZone; void setup() { // attachInterrupt(pbIn, stateChange, CHANGE); interrupt attachInterrupt(pbIn, stateChange, RISING ); pinMode(13, OUTPUT); //13 pin is using for test purpose pinMode(7, INPUT); pinMode(8, INPUT); pinMode(9, INPUT); pinMode(10, INPUT); delay(10); addr0=digitalRead(7); // <=d3 RF data decoder pin addr1=digitalRead(8); // <=d2 RF data decoder pin addr2=digitalRead(9); // <=d1 RF data decoder pin addr3=digitalRead(10); // <=d0 RF data decoder pin rfZone=-1; // Due to M4 latch digitalWrite(13, LOW); // set the LED off } void loop() { int rfVal; while(true) { if( rfZone >=0 ) //SOME RF INTERRUPT HAS BEEN TRIGGERED... { rfVal=rfZone; rfZone=-1; // ----------------------RECEIVING THE RF WHEN LED BLINK------------------------------ digitalWrite(13, HIGH); // set the LED on delay(500); // wait for a .5 second digitalWrite(13, LOW); // set the LED off //------------------------------------------------------------------------------------------------- // Serial.print(rfVal); // Serial.println(" TEST"); // ProcessRFMessage(rfVal); } } delay(100); } //Interrupt handler run automatically when any message received from remote key //Interrupt pin is connected to arduino pin2 //rfZone is -1 when nothing is triggered //rfZone >=0 when any key is receive from remote void stateChange() { d7=digitalRead(7); // <=d3 RF data decoder pin d8=digitalRead(8); // <=d2 RF data decoder pin d9=digitalRead(9); // <=d1 RF data decoder pin d10=digitalRead(10); // <=d0 RF data decoder pin
addr0=addr0 ^ d7; //digitalRead(7); // <=d3 addr1=addr1 ^ d8;// digitalRead(8); // <==d2 addr2=addr2 ^ d9; // digitalRead(9); // <==d1 addr3=addr3 ^ d10; // digitalRead(10);// <==d0
addr2=addr2 << 1; addr1=addr1 << 2; addr0=addr0 << 3; rfZone=(addr3 | addr2 | addr1 | addr0)-1; addr0=d7; // digitalRead(7); // <=d3 addr1=d8; // digitalRead(8); // <==d2 addr2=d9; // digitalRead(9); // <==d1 addr3=d10; // digitalRead(10);// <==d0
}
|
|
|
|
|