Pages: [1]   Go Down
Author Topic: RX TX programming and map function  (Read 443 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm doing project on force sensing resistors (FSRs) and wanna get FSRs data transmitted wirelessly from Arduino Leonardo to computer via Cytron Bluetooth SKKCA.

I have few queries here:

1. I basically know how to analog read the data by using analogRead(Input) function, but I do not have any idea on transmitting the data thru TX (transmit) pin of the arduino to computer, is the coding like this?

int fsrtx = 1
pinMode( fsrtx, OUTPUT) //set it as output just like normal digital output pins

or any other way?

2. the map function " map(value, fromLow, fromHigh, toLow, toHigh)"
Are the fromLow and fromHigh the values (in bits) of read by analogRead  and toLow and toHigh the values output (in bits) to be sent wirelessly?

For example,
map(input, 0, 1023, 0, 255)
Input value is 10 bit size and the input value is mapped into 8 bit size to be output.

Is it correct?

3. Compared to cytron SKKCA bluetooth, is XBEE more convenient to use in terms of Arduino programming?

Need some guidance here, thanks!!!

Offline Offline
Edison Member
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Leonardo has two serial ports.
One for the serial monitor on the PC.
And one on pin 0 and 1.

A library is used for those.

You should try some examples with the 'Serial' library.
And send some strings to the serial monitor.

After that, try Serial1 on the pins 0 and 1. And use that for the bluetooth module.

Pages: [1]   Go Up
Jump to: