Show Posts
Pages: [1] 2
1  Using Arduino / Programming Questions / Re: Help! Analog Comparator+Interrupt Rising Edge on: September 13, 2011, 12:53:57 pm
Sorry, here's it:
Code:
ACSR =
 (0<<ACD) |   // Analog Comparator: Enabled
 (0<<ACBG) |   // Analog Comparator Bandgap Select: AIN0 is applied to the positive input
 (0<<ACO) |   // Analog Comparator Output: Off
 (1<<ACI) |   // Analog Comparator Interrupt Flag: Clear Pending Interrupt
 (1<<ACIE) |   // Analog Comparator Interrupt: Enabled
 (0<<ACIC) |   // Analog Comparator Input Capture: Disabled
 (1<<ACIS1) | (1<ACIS0);   // Analog Comparator Interrupt Mode: Comparator Interrupt on Rising Output Edge
2  Using Arduino / Programming Questions / Help! Analog Comparator+Interrupt Rising Edge on: September 13, 2011, 12:49:56 pm
Is the code below sufficient to use analog comparator to compare AIN0 and AIN1? How can I see the pulses/levels when AIN0 >AIN1 at the Interrupt Rising Edge. Any sample codes, please?
3  Using Arduino / Programming Questions / Re: Arduino serial prints strange character in between figures on: August 23, 2011, 03:21:56 am
Is it possible that its doing that because Serial.flush() is missing?
4  Using Arduino / Programming Questions / Re: Arduino serial prints strange character in between figures on: August 23, 2011, 03:15:44 am
Oh no, thats the c# code on my Unity3d to read the port and write the values in a csv.
5  Using Arduino / Programming Questions / Re: Arduino serial prints strange character in between figures on: August 23, 2011, 02:55:27 am
Code:
SerialPort stream = new SerialPort("COM8", 9600);  //Set the port (com8) and the baud rate (9600, is standard on most devices)


void Start ()
{
stream.Open(); //Open the Serial Stream
}


void Update ()

{
string value = stream.ReadLine();   
var values = value.Split(',');    //Split incoming stream values on comma into arrays

string path = @"c:\data\accelerometer.CSV";

if(!File.Exists(path))
{
using (StreamWriter sw = File.CreateText(path))
{
while (value
sw.WriteLine(value);
}
}

using (StreamWriter sw = File.AppendText(path))
{
sw.WriteLine(value);
}
}
6  Using Arduino / Programming Questions / Arduino serial prints strange character in between figures on: August 23, 2011, 02:28:19 am
I want to use an accelerometer with arduino and Unity3d. I printed the serial port values to csv and noticed that its including some strange characters in the stream;
 
Quote
10 10   7
          40   37   15
          MNb??b??j   
         48   24   17

What can I do to correct this?
7  Using Arduino / Programming Questions / Re: Need help: SerialPort write to CSV on: June 21, 2011, 08:35:26 am
Will check that up, thanks
8  Using Arduino / Programming Questions / Re: Need help: SerialPort write to CSV on: June 21, 2011, 06:15:24 am
I did, but still dont understand most of the things I saw there. I splitted my values from the SerialPort and have something like array[0]....array[4], and this is what I need to write as a CSV. Please I need help
9  Using Arduino / Programming Questions / Re: Need help: SerialPort write to CSV on: June 21, 2011, 04:40:35 am
Yes, I used the C# SerialPort class to read the data(decimal values), and use it in my game engine. But now, I want to write those same values to csv. I'm a beginner. Thanks
10  Using Arduino / Programming Questions / Need help: SerialPort write to CSV on: June 21, 2011, 03:44:42 am
I'm working on a project with makes me read values from my Arduino Mega and use it in a game engine software based on C#. Now I need to write the SerialPort data to CSV. Can someone please put me through this?
11  Using Arduino / Programming Questions / Re: Need help in reading the com port on: June 01, 2011, 06:17:13 am
I'm trying to simulate a process for a virtual simulator system. So instead of connecting actual sensors to the arduino, and have it send the readings to an external application(a game engine), I wrote a random number generator on the arduino, and had it written to the com port. And it works fine in the external application. Now, I need to also get some values from the external application, and send it to arduino. I already did that too. The only thing left is for Arduino to read these values
Thanks
12  Using Arduino / Programming Questions / Re: Need help in reading the com port on: June 01, 2011, 05:27:27 am
So how do you suggest I do this? i really need to write, and read
13  Using Arduino / Programming Questions / Re: Need help in reading the com port on: June 01, 2011, 04:49:36 am
So in that case, do I have to use different com ports? for example, use com8 to write to the external program, and use com3 to read what the external program is sending back. Will that work?
14  Using Arduino / Programming Questions / Need help in reading the com port on: June 01, 2011, 04:17:38 am
I'm a beginner in programming and I made my Arduino to write to an external program through com8. Now the external program (also in c#) is also writing back to the same com8. I need help in reading this values on the arduino board i.e. I want to be able to write to com port and read the external values that  is coming to com port at the same time.
15  Using Arduino / Programming Questions / Re: How do you generate 3 different random numbers in Arduino Mega & send to Serial on: April 11, 2011, 04:39:01 am
Ok
Pages: [1] 2