Sign in

username:

password:



Not a member?

Search rabbit-semi



Search tips

Subscribe to rabbit-semi



Sponsor

controlSUITE™ software
Comprehensive.
Intuitive.
Optimized.

Real-world software for real-time control. Details Here!

Ads

Discussion Groups

See Also

DSPFPGAElectronics

This is a group for folks designing and programming embedded systems using the Rabbit Semiconductor C-programmable microcontroller. Rabbit Semi is a spin-off from Z-World who makes a variety of embedded modules and tools. This group is not affiliated with either Rabbit or Z-World, but is a user forum for sharing ideas, asking questions, flaunting knowledge, and other typical user group stuff. The Rabbit is a powerful uC, supported by a full-featured C-compiler.

Bluetooth - shrs_001 - Oct 27 15:29:26 2009

hi
i m working on eb506 module.
i want to write a simple program to print "hello" N times ......
N is a integer and will asked by program to user
this program will be complied to RCM3000 using Dynamic C version 9.52 and the output will be seen on hypertrm of computer via eb506(bluetooth)

below is the program that will print hello world 10 times

#use a7eng_eb506.lib
#class auto

#define BAUD_RATE 9600L

void main()
{
auto int nCounter;

serFopen(BAUD_RATE);
a7_serFeb506Init();

// Connect to the remote device
serFputs("con 00:11:22:33:44:55\r");
a7_serFwaitForString("ACK\r", 0);

// Wait for the connection to be established and switch into data mode.
// When switching into data mode, a 300ms timeout is required to give the
// module enough time to make the change.
while(!BitRdPortI(PDDR, 4));
BitWrPortI(PDDR, &PDDRShadow, 1, 5);
a7_pauseMs(300);

printf("Connection established\n");

// Send "Hello World" ten times
for(nCounter = 0; nCounter < 10; nCounter++)
{
serFputs("Hello World\r");
a7_pauseMs(1000);
}

// Verify all data has been transmitted and switch to Command Mode
while(serFwrFree() != FOUTBUFSIZE);
BitWrPortI(PDDR, &PDDRShadow, 0, 5);
a7_serFwaitForString("\r>", 0);

// Disconnect from the remote device
serFputs("dis\r");
a7_serFwaitForString("\r>", 0);

serFclose();
}

------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )