Show Posts
|
|
Pages: [1] 2
|
|
1
|
Using Arduino / Sensors / Re: help with ATmega328 with MPU 6050 accelerometer sensor
|
on: May 09, 2013, 09:01:07 pm
|
I also have a MPU-6050 from Elecrow. I connect the VCC to 3V3, GND to GND, SCL to A5, SDA to A4. And I upload the demo code at the bottom of the wiki page. Open the serial monitor, set the rate as 38400. it works fine. Initializing I2C devices... Testing device connections... MPU6050 connection successful a/g: -3236 -3336 12892 -113 -194 -212 a/g: -3360 -3404 12860 -113 -256 -226 a/g: -3344 -3336 12924 -109 -293 -225 a/g: -3404 -3376 12820 -116 -379 -276 a/g: -3108 -3336 12904 -179 12 -231 a/g: -3396 -3404 12840 -224 297 -209 a/g: -3428 -3520 12872 -227 524 -194 a/g: -3372 -3416 12828 -242 726 -108 a/g: -3484 -3428 12684 -251 684 -49 a/g: -3372 -3352 12684 -226 706 -76 a/g: -3380 -3348 12704 -153 604 -107 a/g: -3260 -3512 12768 -85 694 -149 a/g: -3376 -3444 12632 6 380 -392 a/g: -3436 -3504 12768 118 164 -330 a/g: -3380 -3352 12752 169 144 -346 a/g: -3492 -3368 12696 181 247 -249 a/g: -3328 -3380 12884 122 123 -176 a/g: -3352 -3280 13176 59 34 -127 a/g: -3344 -3336 13060 -69 189 -118 a/g: -3384 -3228 12920 -191 392 -154 a/g: -3356 -3236 12992 -281 534 -142 a/g: -3336 -3216 12880 -280 583 -189 a/g: -3388 -3208 12792 -313 581 -153 a/g: -3536 -3380 12704 -178 117 -219 a/g: -3496 -3464 12768 -117 137 -202 a/g: -3480 -3384 12916 -69 104 -196 a/g: -3684 -3336 12908 -109 78 -202 a/g: -3648 -3368 13040 -188 140 -185 a/g: -3456 -3268 12888 -162 112 -198 a/g: -3500 -3280 12744 -193 65 -181 a/g: -3540 -3340 12952 -234 250 -172 a/g: -3584 -3320 12804 -216 151 -190 a/g: -3472 -3364 12696 -156 -180 -273 a/g: -3460 -3372 12772 -165 -149 -186 a/g: -3500 -3356 12888 -142 -238 -179 a/g: -3408 -3396 12844 -194 -97 -150 a/g: -3404 -3404 12872 -195 141 -97 a/g: -3368 -3284 12780 -179 46 -198
|
|
|
|
|
2
|
Using Arduino / Sensors / Re: help with ATmega328 with MPU 6050 accelerometer sensor
|
on: May 03, 2013, 08:30:50 am
|
but in the board there is a switch 3V3_VCC_5V on the lower left corner and I don't know where it goes if in the 3V3 or VCC or 5V.
The VCC is the power for the Atmega328. If press the switch to 3V3, the VCC ==3V3. If press the switch to 5V, the VCC==5V. If VCC==3V3, when the output of the digital pins& the analog pins is high, the voltage is 3.3v. if VCC==5v, it is the same as Arduino.
|
|
|
|
|
5
|
Using Arduino / Programming Questions / Re: GPRS/GSM Shield Time Setting Problems
|
on: January 11, 2013, 09:47:22 pm
|
I have solved this Serial Buffer problem. and I print what I do to solve this The following code is which works as I expect. The Serial port can print again and again. #include <SoftwareSerial.h> SoftwareSerial mySerial(7, 8); // RX, TX int i=0; void setup() { // Open serial communications and wait for port to open: Serial.begin(19200); // set the data rate for the SoftwareSerial port mySerial.begin(19200); } void loop() // run over and over { mySerial.println( "AT+CCLK =\"12/12/27,10:43:50+08\""); delay(50); if (mySerial.available()) Serial.write(mySerial.read()); delay(50); mySerial.println( "AT+CCLK?" ); delay(50); if (mySerial.available()) Serial.write(mySerial.read()); delay(50); i++; if (i==50) { mySerial.flush(); i=0; } }
hope you find this useful when you meet problems with SoftwareSerial Buffer problem.
|
|
|
|
|
8
|
Using Arduino / Programming Questions / Re: GPRS/GSM Shield Time Setting Problems
|
on: January 01, 2013, 01:52:09 am
|
Why you are repeatedly sending a command to set the time is a mystery. That should be done ONCE, in setup().
Thanks for your tips, I will do as you said, setting the time at the setup(). and this program will only be done one time before I upload my project code. And GPRS/GSM Shield will be on power all time to keep its RTC run. The response is supposed to end with some kind of value that says "this is the end of the reply". You need to wait, in a while loop, for that character to arrive BEFORE you send another command.
I changed the wait time to 2000(2s),and it works well . but the result also have a little problem. #include <SoftwareSerial.h> SoftwareSerial mySerial(7, 8); // RX, TX void setup() { // Open serial communications and wait for port to open: Serial.begin(19200); // set the data rate for the SoftwareSerial port mySerial.begin(19200); }
void loop() // run over and over { mySerial.println( "AT+CCLK =\"12/12/27,10:43:50+08\""); delay(500); if (mySerial.available()) Serial.write(mySerial.read()); delay(500); mySerial.println( "AT+CCLK?" ); delay(500); if (mySerial.available()) Serial.write(mySerial.read()); delay(500); } The result shows AT+CCLK ="12/12/27,10:43:50+08" OK
AT+CCLK? +CCLK: "12/12/27,10:43:50+08" OK
AT+CCLK ="12/12/27,10:43:50+08" OK AT+AAAAAAAAAAAAAAAAAThere also are many A .Can you tell me why does this happen? thanks
|
|
|
|
|
9
|
Using Arduino / Programming Questions / Re: GPRS/GSM Shield Time Setting Problems
|
on: December 31, 2012, 06:35:23 am
|
The following is how did I program it with the Serial COM. I program the with the following code. #include <SoftwareSerial.h> SoftwareSerial mySerial(7, 8); // RX, TX void setup() { Serial.begin(19200); // set the data rate for the SoftwareSerial port mySerial.begin(19200); } void loop() // run over and over { if (mySerial.available()) Serial.write(mySerial.read()); if (Serial.available()) mySerial.write(Serial.read()); }
Then I open the Serial COM tool. Program it AT+CCLK ="12/12/27,10:49:50+08"
it returns OK,Then I program it AT+CCLK?
it returns +CCLK: "12/12/27,10:49:53+08" OKSo the question is why I program the GPRS/GSM Shield with the first code, it will lost much data,And I program it through the Serial tool, the GPRS/GSM shield works fine. Is it because the Software library OVERFLOW?
|
|
|
|
|
10
|
Using Arduino / Programming Questions / GPRS/GSM Shield Time Setting Problems
|
on: December 31, 2012, 02:52:39 am
|
I got a GPRS/GSM from http://www.elecrow.com/micro-controllers-c-109/shield-c-109_110/gprsgsm-shield-p-325.html . Its Schematic is showed http://www.elecrow.com/download/ELE%20GPRSshield%20v1.0.pdf. it works well when I program it with Serial COM . but when I program the code to Arduino, there are some problems. it seems that it overflowed ,and some data lost. The following code is what I upload to the Arduino. #include <SoftwareSerial.h> SoftwareSerial mySerial(7, 8 ) ; // RX, TX void setup() { // Open serial communications and wait for port to open: Serial.begin(19200); // set the data rate for the SoftwareSerial port mySerial.begin(19200); } void loop() // run over and over { mySerial.println( "AT+CCLK =\"12/12/27,10:43:50+08\""); if (mySerial.available()) Serial.write(mySerial.read()); delay(200); mySerial.println( "AT+CCLK?" ); if (mySerial.available()) Serial.write(mySerial.read()); delay(200); }
The result is not acted as expected,the Serial COM shows like this : AT+CCLK ="12/12/27,10:43:50+08" OK AT+CCLK? +CCLK: "12/12AAAAAAAAAAAAAAand the following is a lot A. That is to say,these data losts. Does anyone have the same phenomenon? HOW CAN I DO WITH IT? Thanks!
|
|
|
|
|
14
|
Using Arduino / Programming Questions / Time and SIM900
|
on: December 26, 2012, 03:26:34 am
|
|
How can I set the time? I watch the SIM900_AT_Command_Manual_V1.03.pdf , and I find the write command is AT+CCLK=<time> and the format is yy/MM/dd,hh:mm:ss+- zz but I use this command AT+CCLK =<12/12/26,15:04:50+08>, it always returned ERROR
can anybody help me ?
|
|
|
|
|