|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
||||
|
||||
|
Re: 3V3 digital signal to the cRIO
A couple of other possibilities:
-- Use an analog input, instead of a digital one (via the analog breakout board, I mention this mainly in case someone comes along, reads this, and wants something easy and quick) -- Use an opto-isolator (this not only level shifts, but avoids potential problems with ground loops -- you probably don't need to worry about this, but it is very good to be aware of and on the lookout for this type of problem) |
|
#17
|
|||
|
|||
|
Re: 3V3 digital signal to the cRIO
Quoting this because I'd recommend it in most generic situations.
|
|
#18
|
||||
|
||||
|
Re: 3V3 digital signal to the cRIO
Quote:
.Using an analog signal would be getting a little off from what we want here. For something like the raspberry pi or propeller would be hard to interface with a DAC/ADC couple. On the RPi, I don't know if you'd even have enough GPIO! |
|
#19
|
||||
|
||||
|
Re: 3V3 digital signal to the cRIO
Quote:
|
|
#20
|
||||
|
||||
|
Re: 3V3 digital signal to the cRIO
Ah. I get it. However, that seems a little complicated because you will need to craft the code to emulate DI/O. I'm just wondering but has anyone succeeded in using the analog communications with the Jags?
|
|
#21
|
||||
|
||||
|
Re: 3V3 digital signal to the cRIO
Quote:
Code:
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.AnalogChannel;
public class AnalogAsDigital {
AnalogChannel analogInput;
public AnalogAsDigital(int channel){
analogInput = new AnalogChannel(channel);
}
public double getAnalog(){
return analogInput.getVoltage();
}
public boolean getDigital(){
return analogInput.getVoltage() < 2;
}
}
From the datasheet Quote:
|
|
#22
|
||||
|
||||
|
Re: 3V3 digital signal to the cRIO
I guess I want to take a step back and ask the intent.
Are you simulating digital input to test programing on the cRio, or are you using it to pass information the Pi has already determined to the cRio to take action? I ask because if you are looking to pass information it may be much easier to use i2c if you don't want to use hub points on the radio, or just pass the data between the two on an ethernet connection (UDP or TCP). But if you are looking to simulate other sensor data then the other discussions here definitely apply. I would look at the logic level shifters from spark fun. That would be the safe way to do it. |
|
#23
|
||||
|
||||
|
Re: 3V3 digital signal to the cRIO
Network isn't the best approach when you want to get the newest data with the least delay. Also, if you are processing a sensor a thousand times a second, offboard, you want a very fast and reliable connection. While ethernet can get close, it isn't exactly the "best" way to go!
It is also relatively easy to code i2C on the Pi compared to another technology because of the libraries out there and the documentation that they have! Last edited by yash101 : 30-12-2013 at 14:37. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|