Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Troubleshooting / Re: Java segfaults when recieving serial data on: January 04, 2010, 01:06:00 am
Got it. The solution was to install a newer version of rxtx and copy its librxtxSerial.so to /usr/share/arduino/lib.
2  Forum 2005-2010 (read only) / Troubleshooting / Re: Java segfaults when recieving serial data on: January 03, 2010, 08:26:11 pm
That did seem to solve some other minor issues I was having, but this one is still happening:
Quote
Binary sketch size: 2312 bytes (of a 14336 byte maximum)
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f7c1a528edd, pid=12228, tid=140171002066704
#
# JRE version: 6.0_17-b04
# Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode linux-amd64 )
# Problematic frame:
# C  [librxtxSerial.so+0x6edd]  read_byte_array+0x3d
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid12228.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
./arduino: line 20: 12228 Aborted                 java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base
3  Forum 2005-2010 (read only) / Troubleshooting / Java segfaults when recieving serial data on: January 03, 2010, 01:43:59 am
The Arduino IDE is dying with this error when recieving serial data from the Arduino with the monitor open:

Code:
RXTX Warning:  Removing stale lock file. /var/lock/LCK..ttyUSB0
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fbf18827edd, pid=19125, tid=140458726655760
#
# JRE version: 6.0-b16
# Java VM: OpenJDK 64-Bit Server VM (14.0-b16 mixed mode linux-amd64 )
# Distribution: Custom build (Tue Nov 10 14:13:51 UTC 2009)
# Problematic frame:
# C  [librxtxSerial.so+0x6edd]  read_byte_array+0x3d
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid19125.log
#
# If you would like to submit a bug report, please include
# instructions how to reproduce the bug and visit:
#   http://icedtea.classpath.org/bugzilla
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
./arduino: line 20: 19125 Aborted                 java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base

I'm running Arduino 0017 on 64-bit Linux. Any suggestions?
4  Forum 2005-2010 (read only) / Bugs & Suggestions / Underscores randomly disappear in IDE on: December 21, 2009, 12:40:28 am
Often when I use an underscore in my code it just decides to not show up at all. (Can't seem to post a screenshot because this is my first post here, but they just show up as spaces.) If I click randomly in that area a few times they come back, then they disappear again a few seconds later.

Also, is there a way to make the IDE indent with tabs rather than spaces?
5  Forum 2005-2010 (read only) / Syntax & Programs / Re: if statement and ldr on: January 10, 2010, 12:13:58 am
delay(1000) between each check of the LDR?
6  Forum 2005-2010 (read only) / Syntax & Programs / Re: How to Create Array of Objects? on: January 03, 2010, 06:34:55 pm
Code:
int[] myArray = new int[3];
That looks like Java. C++ equivalent is
Code:
int myArray[3];

Code:
OneWire buses[3];
I see no problem with this, what was the error you got?
7  Forum 2005-2010 (read only) / Syntax & Programs / Re: Functions - return array or multiple variables? on: January 03, 2010, 12:51:55 am
Quote
My gcc-4.2 accepted the code posted by nkcelectronics but gave a warning (incompatible pointer type) during compiling. The program worked well despite the warning.
In C an array IS a pointer. You should be calling getdat(data) rather than   getdat(&data);. The latter will probably "work" but will overwrite some random place in memory which will not be where you intended.

("data" is equivalent to "&data[0]", i.e. the address of the start of the array. "&data" is the address of the address of the start of the array)
8  Forum 2005-2010 (read only) / Interfacing / Re: How do I easily program a bunch of Duemilanoves? on: January 12, 2010, 06:25:51 pm
I'm not sure if there's anything already around for it, but you could modify the IDE to enumerate all the USB devices, and send the program to each one that looks like an Arduino. Then just chain up a few hubs depending on how many Duemilanoves you're talking about, connect all the Arduinos, and watch the fun.

(If you do have to use hubs, I'd assume powered ones would be better for this.)
9  Forum 2005-2010 (read only) / Interfacing / CCD interfacing problem on: January 09, 2010, 07:56:16 pm
I've got a CCD (UPD3799CY, http://www.alldatasheet.com/datasheet-pdf/pdf/6939/NEC/UPD3799CY.html) wired up to my Duemilanove-based robot rover thing and need a bit of help with my driver.

It seems to almost work, except that I seem to be repeatedly getting the value from pixel 1 rather than moving across to pixel 5300*. I know this because shining a flashlight near pixel 1 gives me light even when reading from the other end, but shining on pixel 5300 never returns light. All the digital pins are set to output mode. This is the relevant code:

Code:
#define CCD_RED_INPUT 0
#define CCD_GREEN_INPUT 1
#define CCD_BLUE_INPUT 2
#define CCD_SHIFT_CLOCK_1 12
#define CCD_SHIFT_CLOCK_2 6
#define CCD_TG_CLOCK_RED 9
#define CCD_TG_CLOCK_GREEN 10
#define CCD_TG_CLOCK_BLUE 11
#define CCD_RESET_CLOCK 7
#define CCD_REAL_RESOLUTION 5300

typedef struct { int red, green, blue; } pixel;
pixel optical_black;

void ccd_skip(int n)
{
  for (int i = 0; i < n; i++)
  {
    digitalWrite(CCD_RESET_CLOCK, LOW);
    digitalWrite(CCD_SHIFT_CLOCK_1, HIGH);
    digitalWrite(CCD_SHIFT_CLOCK_2, LOW);
    delayMicroseconds(1);
    digitalWrite(CCD_RESET_CLOCK, HIGH);
    delayMicroseconds(1);
    digitalWrite(CCD_SHIFT_CLOCK_1, LOW);
    digitalWrite(CCD_SHIFT_CLOCK_2, HIGH);
    delayMicroseconds(1);
  }
}

void ccd_read(pixel& rv)
{
  
  digitalWrite(CCD_SHIFT_CLOCK_1, HIGH);
  digitalWrite(CCD_SHIFT_CLOCK_2, LOW);
  digitalWrite(CCD_RESET_CLOCK, LOW);
  delayMicroseconds(1);
  digitalWrite(CCD_RESET_CLOCK, HIGH);
  delayMicroseconds(1);
  digitalWrite(CCD_SHIFT_CLOCK_1, LOW);
  digitalWrite(CCD_SHIFT_CLOCK_2, HIGH);
  delayMicroseconds(2);

  rv.red = max(0, analogRead(CCD_RED_INPUT) - optical_black.red);
  rv.green = max(0, analogRead(CCD_GREEN_INPUT) - optical_black.green);
  rv.blue = max(0, analogRead(CCD_BLUE_INPUT) - optical_black.blue);
  
  digitalWrite(CCD_RESET_CLOCK, HIGH);
  delayMicroseconds(1);

  digitalWrite(CCD_SHIFT_CLOCK_1, LOW);
  digitalWrite(CCD_SHIFT_CLOCK_2, HIGH);
  delayMicroseconds(1);
}

void ccd_read_row()
{
  // reset the CCD
  digitalWrite(CCD_SHIFT_CLOCK_1, HIGH);
  digitalWrite(CCD_SHIFT_CLOCK_2, LOW);
  delayMicroseconds(1);
  digitalWrite(CCD_TG_CLOCK_RED, HIGH);
  digitalWrite(CCD_TG_CLOCK_GREEN, HIGH);
  digitalWrite(CCD_TG_CLOCK_BLUE, HIGH);
  for (int i = 0; i < 5; i++)
  {
    digitalWrite(CCD_RESET_CLOCK, HIGH);
    delayMicroseconds(1);
    digitalWrite(CCD_RESET_CLOCK, LOW);
    delayMicroseconds(1);
  }
  digitalWrite(CCD_TG_CLOCK_RED, LOW);
  digitalWrite(CCD_TG_CLOCK_GREEN, LOW);
  digitalWrite(CCD_TG_CLOCK_BLUE, LOW);
  delayMicroseconds(1);
  digitalWrite(CCD_SHIFT_CLOCK_1, LOW);
  digitalWrite(CCD_SHIFT_CLOCK_2, HIGH);
  Serial.println("CCD reset, starting read");

  ccd_skip(31);

  // get optical black
  // FIXME are all the OB pixels identical? if not average them or something.
  optical_black = {0, 0, 0};
  ccd_read(optical_black);

  Serial.print("Optical black is ");
  Serial.print(optical_black.red);
  Serial.print(" ");
  Serial.print(optical_black.green);
  Serial.print(" ");
  Serial.print(optical_black.blue);
  Serial.print("\n");

  // skip over more invalid pixels
  ccd_skip(32);
  
  // read in the pixels
  pixel p;
  for (int i = 0; i < CCD_REAL_RESOLUTION; i++)
  {
    ccd_read(p);
    
    Serial.print(i);
    Serial.print(" ");
    Serial.print(p.red);
    Serial.print(" ");
    Serial.print(p.green);
    Serial.print(" ");
    Serial.print(p.blue);
    Serial.print("\n");
  }
}

* Yes, I know 5300 pixels won't fit in the Arduino's memory - the plan, once I get this bug out of the way, is to average pixels together while reading to create a lower-resolution image that will fit.
10  Forum 2005-2010 (read only) / Interfacing / Re: Voltage limit of AREF on: January 03, 2010, 01:54:42 am
That's effectively what I was asking. 5.1V probably won't hurt anything but 12V is a bad idea. I suppose I'll start making some voltage dividers...
11  Forum 2005-2010 (read only) / Interfacing / Voltage limit of AREF on: January 03, 2010, 01:02:45 am
Is there a limit to the voltage I can supply to AREF? It looks like the two builtin values I can use are 5V and 1.1V, but it's unclear to me whether that means "you can use any value between 1.1V and 5V" or "you can use any reasonable value, just don't try to run 120VAC into AREF". I'm trying to connect a scanner CCD and the datasheet says it outputs up to 12V.
12  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Power down sequence? on: January 10, 2010, 12:00:07 am
You could use the non-permanent power to drive a transistor/relay to let you know when it's cut off. Just check for digitalRead(THAT_PIN) == HIGH at the end of every loop() iteration.

Alternative method that just came into my head and may or may not be feasible: if the two power sources are different voltages you could feed one into an analog input (through a voltage divider, because at least one of them is 12V) and check for that going past a certain threshold.

If you actually need to switch between the two power supplies, I'm fairly sure you'd need some external circuitry for that (however, I'll probably be proven wrong.)
13  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: arduino + 12" lcd on: January 04, 2010, 08:32:28 pm
The Mega, which uses the most powerful chip of all the Arduino models, has 8kB of RAM. A single frame on a 640x480 8-bit color display is 300kB. You're going to need something more powerful than an Arduino.

If you insist on trying with an Arduino (it's not completely impossible, it'll just be really slow and complicated) you'll have to look around for the pinout of the specific LCD you're using - they're all different. Alternatively, you could leave the LCD attached to the laptop and have the Arduino send the numbers to display to a program running on the laptop. (Computers already have the special electronics needed to drive displays, it's usually known as a "video card". You'd essentially wind up building your own video card any other way.)
14  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: arduino + 12" lcd on: January 04, 2010, 06:37:16 pm
I remember seeing a QVGA touchscreen shield somewhere on these forums, search around a bit. There may be something bigger but remember as the size goes up the speed and available power for other things will go down.
15  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: arduino + 12" lcd on: January 04, 2010, 05:55:11 pm
Everything is possible. Some things are just more possible than others.

Laptop LCD connectors are not standardized (they don't even resemble VGA or anything) and have a LOT of wires. Even if you did manage to get it to work you'd have a horrible framerate.

If the laptop still works, you could run something on it to let the Arduino draw to it, but even that probably wouldn't be fast enough to be useful for anything.
Pages: [1]