read analog value from xbee (non serially) - arduino

I'm trying to send an analog value from xbee to another xbee (WHICH IS CONNECTED TO ARDUINO). But I don't want to read this value serially (x=Serial.read();).
I would like to read this value from an arduino's analog input (x=analogRead(A0);). Can I pass an analog value from 1st xbee input pin to 2nd xbee output pin and connect this pin with ex.arduino's analog input (A0) and process it? If it can be done, how does this occur? (sorry for my english)

This is indeed possible. Xbee's have DAC and digital line support. Check out the user manual found in this Manual
The information you're going to need is on page 12. This is for series one xbee's.
For series two xbee's the process is different and can be found in this manual
manual on page 41. Good luck!

I would suspect you would be better off using xbee API and just do an AT command to read pin, then transfer it over serial TX out to the arduino RX in.

Related

STM32DUINO and analogRead for stm32f103c8t6

I have custom board on which I can upload my code generated from platformio and as board bluepill_f103c8. And I can make led blink etc. but when I want to do analogRead it always returns 0.
I'm trying to read from PA8 pin.
In my setup I put that pin as INPUT_ANALOG, do I need to do something else in order to get the reading?
Voltage that's on pin is about 0.25V that I'm trying to read.
According to STM32F103 Datasheet, page 34, any of 3 onboard ADCs simply do not have the ability to connect to PA8. PA8 can only work as simple GPIO (default, reads only 0 and 1), or as USART1_CK, TIM1_CH1, MCO in alternative configuration.
Arduino can use it as PWM output, or software USART, but there is no way to get analog reading from it.
If you really need to read analog voltage coming to that line, you would have to modify your board and solder PA8 to one of PA0..PA7, PB0..PB1, PC0..PC5 and re-configure ADC to read from that line.
#TonoNam, regarding your problem: unless PA1 is permanently damaged, it is fully capable of working with ADC, so there is something wrong with initialization or reading procedure.
Reference the pinout diagram here https://wiki.stm32duino.com/index.php?title=File:Bluepillpinout.gif
analogRead will only work with the pins which have associated ADC channels.
So this is PA0 through PA7, and then PB0 and PB1, so I guess this is your issue.
Looks like PA8 is a PWM output.

Does a PIC 16197 Microcontroller have D/A converter?

I want to send out values with analog pins which would be read by analog pins of any other microcontroller.
It appears that you're referring to the PIC16F1619, all the related information that you can look for your requirements is inside the datasheet, I invite you to look at PIC16F1619 Web Page from Microchip and you will see all of the features and the current documentation to work with all of the peripherals included in this particular Microcontroller, however, according to the datasheet, the RA0 pin from this MCU has the feature to give an 8bit DAC output.
I hope this could help.

STM32F4 - External input source is not detected in GPIO.pulldown mode

I am currently working on a project that involves an STM32 F4 Discovery board where I am trying to use an external input source as the input to the GPIO pin. The external input source is a power supply set to 3.3V. The pins are set to mode GPIO_PULLDOWN such that the input is grounded when no particular value is assigned. However, I am unable to change the input value once it is grounded. When I set the power supply to give 3.3V to the input pin, it still stays grounded. But when I connect a 3.3V pin on the board to the input pin, it gets 3.3V as input. I have noticed one thing, which I find a bit strange: when I use a multimeter to measure the input pin, the multimeter measures 3.3V on the input pin when I use GND from the power supply and the VCC from the input pin. But when I use the GND pin from microcontroller and VCC from the input pin, it outputs 0V.
Any idea how I can solve this? I am quite fresh on this topic, so all advice would be appreciated. Thank you in advance.
Figured it out. The ground on the power supply is isolated, thus I needed to connect the ground on power supply with the microcontroller.

How to use a DAC on a PWM input generated by timer interrupts?

I'm using a 12-bit Linear LTC2631 DAC, and wish to convert my PWM signal to an analog one via I2C. I am currently not able to come up with an algorithm, and how would the the DAC need to programmed to take in the PWM input and then generate an output. I'm using a Pro Micro 3.3V board.
Any help would be appreciated, including stuff over the internet which I could read up?
Thanks!
If you're going to use an I2C DAC IC like the LTC2631 you don't need PWM at all. You just pass a binary value to the IC via I2C and it will be converted to an analog voltage.
If you want to use PWM to generate an analog signal you might want to filter the output so it doesn't look all square. Take a look at:
http://interface.khm.de/index.php/lab/experiments/arduino-dds-sinewave-generator/
and:
http://www.avdweb.nl/arduino/hardware-interfacing/super-simple-dac.html
Best.
Yes, if you have PWM signals then you don't need to have a DAC at all.just attach a low pass filter after PWM and you will have analog signals.
But if you want to use any I2C DAC you can just provide it binary numbers and it will automatically convert into analog signals.
PWM and DAC both are different method of generating analog signals you don't need to combine it.

How do I make my speakers as an output on Arduino?

I want to use the readings off an LDR to dictate the sound. I know have to do this with a buzzer in my circuit and I know how to call my speakers in java, but I don't have any idea how to do this in Arduino.What I want exactly is something along the line of:
input = analog read(pin 6);
tone(LAPTOP SPEAKERS, input);
So you want to use laptop to play music? them your arduino will send a messagge to the PC (by Serial, Bluethoot, Wifi, Ethernet, smoke signal) and a pc program will read that signal and play the according sound.
Or you can use the arduino with a buzzer, or with a speaker jack, and use the tone() function, or a mp3 shield if you need specific sound.
You can send the readed value from pin6 over serial to pc , and use this value on java to generate a sound at this frequency. Send it over serial it's not a problem, it's so easy as Serial.print(input);, this will sent the readed value (0 - 255) to pc.
The main problem for me will be generate the tone at specific frequency on java, and it's not so hard.

Resources