We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › First attempts
Page Index Toggle Pages: 1
First attempts (Read 579 times)
First attempts
Nov 10th, 2007, 1:46pm
 
OS:  Mac OS X Leopard.  Got VCP drivers, can see serial device, can open it.

Get Semantic Error: No accessible field named "LOW" was found in type "Temporary_5629_9527".

when I try to use   digitalWrite(ledPin, LOW); or   digitalWrite(ledPin, HIGH);

So far, program is:


import processing.core.*;
import processing.serial.*;


Serial port; // Create object from Serial class
int ledPin = 4;

void setup() {
 size(200, 200);
 noStroke();
 frameRate(10);
 // Open the port that the board is connected to and use the same speed (9600 bps)
 port = new Serial(this,Serial.list()[0], 9600);
}

void draw() {
 background(255);
 if (mouseOverRect() == true) {  // If mouse is over square,
   fill(204);                    // change color and
 digitalWrite(ledPin, LOW);
 } else {                        // If mouse is not over square,
   fill(0);                      // change color and
   digitalWrite(ledPin, HIGH);
 }
 rect(50, 50, 100, 100);         // Draw a square
}

boolean mouseOverRect() { // Test if mouse is over square
 return ((mouseX >= 50) && (mouseX <= 150) && (mouseY >= 50) && (mouseY <= 150));
}
Re: First attempts
Reply #1 - Nov 10th, 2007, 2:00pm
 
I think digitaRead and digitalWrite are Arudino code, not processing.

If you want to use Arudino code you have to use the Arudino software, and any problems should be discussed on the Arudino forum.
Re: First attempts
Reply #2 - Nov 10th, 2007, 2:20pm
 
Quote:
I think digitaRead and digitalWrite are Arudino code, not processing.

If you want to use Arudino code you have to use the Arudino software, and any problems should be discussed on the Arudino forum.



OK, I see.. no, I have a Wiring board.


So..  I need http://dam.mellis.org/w4p/ to write I assume??

I tried http://dam.mellis.org/w4p/wiring_out.pde

and I get


/tmp/build38916.tmp/Temporary_4562_9426.java:36:1:36:6: Semantic Error: Type "Wiring" was not found.
Re: First attempts
Reply #3 - Nov 10th, 2007, 2:24pm
 
Quote:
I think digitaRead and digitalWrite are Arudino code, not processing.

If you want to use Arudino code you have to use the Arudino software, and any problems should be discussed on the Arudino forum.



Though I think it's pretty odd that
http://wiring.org.co/learning/examples/led_blinks.html

uses digitalWrite ..
Re: First attempts
Reply #4 - Nov 10th, 2007, 3:30pm
 
Ah I see, both arudino and wiring both use digitalRead/Write

Yes I think you need the wiring4processing library.
Re: First attempts
Reply #5 - Nov 10th, 2007, 5:02pm
 
Quote:
Ah I see, both arudino and wiring both use digitalRead/Write

Yes I think you need the wiring4processing library.



Yes, I realized that I needed to download Wiring, not Processing.  Got the little puppy working now.. thanks!
Page Index Toggle Pages: 1