# I have GPS, SONAR and two BLDC motors connected. I have to send data to my PC. I have radio-link. How can I send this data?

#### ericgibbs

Joined Jan 29, 2010
13,277
hi umer,
Downloaded your file. will check, I do not have an OLED.

Look at this option,no buttons, no OLED, needs a little tidy up, it works.
To use:
The Serial0 port input: Tyyyy,mm,dd,hh,mm,ss , will set the RTC and give a Set Time reply
E

C-like:
/// Serial0
if (stringComplete0){
strID0=(dataString0.substring(0,1));
//Serial.println("Ser0");
if (strID0 == "\$"){
Serial.print(dataString0);
File dataFile = SD.open("datalog.txt", FILE_WRITE);
// if the file is available, write to it:
if (dataFile) {
dataFile.print(dt);
dataFile.print(" ");
dataFile.print(tm);
dataFile.print(msec);
dataFile.print(",");
dataFile.print(dataString1);
dataFile.close();
} else {
Serial.println("error opening datalog.txt");
} }
// clear the string:

// Expected DateTime String=  T2011,06,18,08,52,30
//
if (strID0 == "T"){
String strYear=(dataString0.substring(1,5));
int myYear = strYear.toInt();
String strMonth=(dataString0.substring(6,8));
int myMonth = strMonth.toInt();
String strDay=(dataString0.substring(9,11));
int myDay = strDay.toInt();
String strHour=(dataString0.substring(12,14));
int myHour = strHour.toInt();
String strMin=(dataString0.substring(15,17));
int myMin = strMin.toInt();
String strSec=(dataString0.substring(18,20));
int mySec = strSec.toInt();

strID0="";
}
//Date Time Check
DateTime now = rtc.now();
Serial.print  (now.year());
Serial.print  (now.month());
Serial.println (now.day());
Serial.print  (now.hour());
Serial.print  (now.minute());
Serial.println (now.second());

dataString0 = "";
stringComplete0 = false;
strID0="";
}

#### umerrai1

Joined Mar 29, 2021
233
The swcond one is working fine.

#### ericgibbs

Joined Jan 29, 2010
13,277
The swcond one is working fine.

I do not understand what this means.??

#### umerrai1

Joined Mar 29, 2021
233
Sorry for my mistake. The last code I have sent you is working.

#### ericgibbs

Joined Jan 29, 2010
13,277
Sorry for my mistake. The last code I have sent you is working.
hi umer,
OK, but do you plan to actually use my Code in your project, it was written for a DS1307.... your last posted Code was for a DS3231.???

E

Update:
Who wrote that Code for the DS3231.??

Last edited:

#### umerrai1

Joined Mar 29, 2021
233
No, I took it from the internet. 3231 code can work with 1307 too. But I have changed the library from 3231 to 1307.

#### ericgibbs

Joined Jan 29, 2010
13,277
hi umer,
What is the purpose of the Keypad and OLED.?

Do you plan to use a DS1307 or a DS3231 RTC.

E

#### ericgibbs

Joined Jan 29, 2010
13,277
hi.
Look at this, it is all you need for selecting 4 possible Baud rates. mounted on your main PCB.
Uses 2 pins of the MCU
E

00 = 4800 Baud
01 = 9600
10 = 19200
11 = 115200

#### umerrai1

Joined Mar 29, 2021
233
You may say it is a modern version of the data logger. It will show the selected baud rate and also the RTC time on it.

#### ericgibbs

Joined Jan 29, 2010
13,277
It maybe modern, but if you are selling this product, it adds to the cost of the unit and also its another piece of kit, which if lost or fails, would make it impossible to set the Baud Rate or the Time...

#### umerrai1

Joined Mar 29, 2021
233
Sir, I am getting reading on analog pin of arduino from 0 to 1023. What type of value is this? Is it ASCII characters or digital?

#### ericgibbs

Joined Jan 29, 2010
13,277
hi,
It is just a Count value, use the MAP command to covert to the Voltage range as required.

E

#### umerrai1

Joined Mar 29, 2021
233
Fine sir.

#### umerrai1

Joined Mar 29, 2021
233
I have a bldc motors. it is working in both directions. but I need to start this motor slowly to increase its velocity not suddenly.

#### umerrai1

Joined Mar 29, 2021
233
Sir, I have a question.
How can I increase or decrease gradually acceleration of BLDC motor. Can you please guide me.

#### Attachments

• 18.6 KB Views: 1

#### ericgibbs

Joined Jan 29, 2010
13,277
hi umer,
Is the HEX file the only piece of Code information you have.?
Where did you get the HEX code
E

#### umerrai1

Joined Mar 29, 2021
233
This is the code.

#### Attachments

• 4.9 KB Views: 2

#### ericgibbs

Joined Jan 29, 2010
13,277
hi,
It is running in my PC.
Who wrote this program Code.?
E

#### umerrai1

Joined Mar 29, 2021
233
I wrote it. I know it is working. But motors starts at full speed. I want that motor increases it's speed slowly slowly.