caramoan tour package

caramoan tour package

Author Topic: sms sending from pc to cp w/out using internet  (Read 3117 times)

Offline paranz

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4525
  • Pogi/Ganda Points: 177
  • Gender: Male
  • 1/4W resistor specialist
    • RapidSignal Electronics
Re: sms sending from pc to cp w/out using internet
« Reply #20 on: July 07, 2008, 09:25:17 PM »
ako din magtatanong...

yung mga at-commands ba, ipiniprint lang sa serial port(assuming serial port nakakabit ang gsm modem)?
so kung may nagtext sa PC ng "Hoy, pogi!"
ang reply ko sa program sa C:


printf("AT+CMGS="0917111222\r");
printf("ano yun??!! ctrl-z");      // Pano ba ang Ctrl-z????!

tama ba itong code?  ???

Code: [Select]

printf("AT+CMGS="0917111222\r");
printf("ano yun??!!");
putchar(26);          //hexadecimal 1A in decimal

PIC16 Programming Tutorial using MPLAB and Hi-Tech C
www.rapidsignalph.com/tutorials/pic16-tutorials

Arduino & gizDuino Tutorials
www.rapidsignalph.com/tutorials/arduino-tutorials

Philippine Electronics Forum

Re: sms sending from pc to cp w/out using internet
« Reply #20 on: July 07, 2008, 09:25:17 PM »

Offline rdpzycho

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 10728
  • Pogi/Ganda Points: 632
  • Gender: Male
  • Respect Begets Respect
    • rdpzycho
Re: sms sending from pc to cp w/out using internet
« Reply #21 on: July 07, 2008, 09:41:44 PM »
kung yung putchar tutuloy din dun sa string, yup. kailangan din yung quotation marks. hindi ko na maalala ang printf ng C. lagi ako gumagamit ng C pero parang antagal ko nang hindi gumamit ng printf. ;D
‎"Divide each difficulty into as many parts as is feasible and necessary to resolve it."
- Rene Descartes

"For every difficult problem there is always a simple answer and most of them are wrong."
- Clayton Paul

Philippine Electronics Forum

Re: sms sending from pc to cp w/out using internet
« Reply #21 on: July 07, 2008, 09:41:44 PM »

Offline paranz

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4525
  • Pogi/Ganda Points: 177
  • Gender: Male
  • 1/4W resistor specialist
    • RapidSignal Electronics
Re: sms sending from pc to cp w/out using internet
« Reply #22 on: July 07, 2008, 10:19:01 PM »
hindi ko kasi matest yung code above. i got an old modem to test AT commands pero hindi naman kailangan yung CNTL+Z.

Sana makahanap na ako ng nokia datacable.  ::)
PIC16 Programming Tutorial using MPLAB and Hi-Tech C
www.rapidsignalph.com/tutorials/pic16-tutorials

Arduino & gizDuino Tutorials
www.rapidsignalph.com/tutorials/arduino-tutorials

Philippine Electronics Forum

Re: sms sending from pc to cp w/out using internet
« Reply #22 on: July 07, 2008, 10:19:01 PM »

Offline Born2BeWired

  • Technical People
  • Diesel Generator
  • *****
  • Posts: 1113
  • Pogi/Ganda Points: 168
  • Gender: Male
  • Analog and Precision Circuits Junkie
    • e-Gizmo Mechatronix Central
Re: sms sending from pc to cp w/out using internet
« Reply #23 on: July 07, 2008, 11:14:00 PM »
tama ba itong code?  ???

Code: [Select]

printf("AT+CMGS="0917111222\r");
printf("ano yun??!!");
putchar(26);          //hexadecimal 1A in decimal



You can also embed special characters sa string using the "\nnn" octal format

printf("ano yun??!!\032");

\032 octal = 0x1A hex.

kung yung putchar tutuloy din dun sa string, yup. kailangan din yung quotation marks. hindi ko na maalala ang printf ng C. lagi ako gumagamit ng C pero parang antagal ko nang hindi gumamit ng printf. ;D

Mas madalas akong magprogram using assembly. If ever I have to use C, ayaw ko rin gamitin ang printf. Malakas lumamon ng code memory space. Dala dala ko pa rin itong habit na ito kahit na malalaki na ngayon ang code memory space ng mga micro. ;D
Electronics <- Once you got a taste of it, you will never get enough.

Insanity <- Doing the same thing, expecting different results.

"The more I learn, the more I am humbled."

Philippine Electronics Forum

Re: sms sending from pc to cp w/out using internet
« Reply #23 on: July 07, 2008, 11:14:00 PM »

Offline rdpzycho

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 10728
  • Pogi/Ganda Points: 632
  • Gender: Male
  • Respect Begets Respect
    • rdpzycho
Re: sms sending from pc to cp w/out using internet
« Reply #24 on: July 08, 2008, 07:21:24 AM »
yung typical printf kasi minsan umaabot ng 500 bytes to 2K code sa micro kaya hindi ko nagagamit. ;D kagabi ko pa iniisip paano nagkakabit ng character code sa printf, buti pinaalala niyo sir. hehe. wala kasi sa C book ko pero ginagamit ko dati sa DOS based C para gumawa ng borders. ;D
‎"Divide each difficulty into as many parts as is feasible and necessary to resolve it."
- Rene Descartes

"For every difficult problem there is always a simple answer and most of them are wrong."
- Clayton Paul

Philippine Electronics Forum

Re: sms sending from pc to cp w/out using internet
« Reply #24 on: July 08, 2008, 07:21:24 AM »

Offline paranz

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4525
  • Pogi/Ganda Points: 177
  • Gender: Male
  • 1/4W resistor specialist
    • RapidSignal Electronics
Re: sms sending from pc to cp w/out using internet
« Reply #25 on: July 08, 2008, 08:55:58 AM »
nakagamit na ako ng printf() on a software UART for my pic16f84a. Ok lang naman     8)
PIC16 Programming Tutorial using MPLAB and Hi-Tech C
www.rapidsignalph.com/tutorials/pic16-tutorials

Arduino & gizDuino Tutorials
www.rapidsignalph.com/tutorials/arduino-tutorials

Offline marcelino

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6016
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: sms sending from pc to cp w/out using internet
« Reply #26 on: July 21, 2008, 01:02:49 PM »
You can also embed special characters sa string using the "\nnn" octal format

printf("ano yun??!!\032");

\032 octal = 0x1A hex.

Mas madalas akong magprogram using assembly. If ever I have to use C, ayaw ko rin gamitin ang printf. Malakas lumamon ng code memory space. Dala dala ko pa rin itong habit na ito kahit na malalaki na ngayon ang code memory space ng mga micro. ;D

pano ba ang command line kung di gagamit ng printf?
kunwari yang sample program...
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Offline rdpzycho

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 10728
  • Pogi/Ganda Points: 632
  • Gender: Male
  • Respect Begets Respect
    • rdpzycho
Re: sms sending from pc to cp w/out using internet
« Reply #27 on: July 21, 2008, 01:43:45 PM »
sa C?

isa isa ilalabas using array. kanya kanyang diskarte na rin yun. ;D
‎"Divide each difficulty into as many parts as is feasible and necessary to resolve it."
- Rene Descartes

"For every difficult problem there is always a simple answer and most of them are wrong."
- Clayton Paul

Offline paranz

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4525
  • Pogi/Ganda Points: 177
  • Gender: Male
  • 1/4W resistor specialist
    • RapidSignal Electronics
Re: sms sending from pc to cp w/out using internet
« Reply #28 on: July 21, 2008, 02:30:15 PM »
pano ba ang command line kung di gagamit ng printf?
kunwari yang sample program...

here is a simple function (in hi-tech C)

Code: [Select]

void put_string(const char * s) //send string to UART for transmission
{
while(*s){ //while end of string is not reached
while(!TXIF); //wait until previous character is transmitted
TXREG = *s++; //write character to transmit register and
} //char is transmitted immediately when hardware
//is able; then pointer is increment to point to
//next character in the string array

}


sample program:

Code: [Select]

void main()
{
init_uart(); //initialize UART, assume function is declared somewhere
put_string("sevenstring impakta\n"); //send string to UART
//you can view the output
//using Hyperterminal
while(1);
}



PIC16 Programming Tutorial using MPLAB and Hi-Tech C
www.rapidsignalph.com/tutorials/pic16-tutorials

Arduino & gizDuino Tutorials
www.rapidsignalph.com/tutorials/arduino-tutorials

Offline paranz

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4525
  • Pogi/Ganda Points: 177
  • Gender: Male
  • 1/4W resistor specialist
    • RapidSignal Electronics
Re: sms sending from pc to cp w/out using internet
« Reply #29 on: July 21, 2008, 02:39:01 PM »

for AT commands:

Code: [Select]

put_string("AT+CMGS="0917111222\032");


\032 = CNTRL+Z

OT:

@marce

CP number mo ba yan?  :D

PIC16 Programming Tutorial using MPLAB and Hi-Tech C
www.rapidsignalph.com/tutorials/pic16-tutorials

Arduino & gizDuino Tutorials
www.rapidsignalph.com/tutorials/arduino-tutorials

Philippine Electronics Forum

Re: sms sending from pc to cp w/out using internet
« Reply #29 on: July 21, 2008, 02:39:01 PM »

 

Privacy Policy

Contact Us: elabph@yahoo.com