Cant use Serial library! Can find it inside folder.

Hi!

I have been trying to find guides on how to send keyboard inputs to the arduino from a pc using usb. I found this guide on the website http://arduino.cc/en/Tutorial/PhysicalPixel#.Uw5IYvl5NWN that guides you how to turn off and on a led using the keyboard. I dowloaded the program Processing as the guide said and installed it. The problem I have now is that I cant use the serial library. It cant find some Syntexs that should be in the library like Serial.begin() - Arduino Reference.

Anyone got a fix on this problem?

Picture on the problem:

//JohanH

(deleted)

Its Serial.begin (...) not Serial.Begin (...) - you must get the
case right.

spycatcher2k:
remove the first line : import . . . .

If I dont use that I will get "Cannot find anything named "Serial".

MarkT:
Its Serial.begin (...) not Serial.Begin (...) - you must get the
case right.

Get the same error anyway, "The Function begin(int) does not exist.

You dont know any other libraries that does the same thing? Have been looking but not really found one for it. :frowning:

The serial setup is completely different for Processing than for Arduino. In Processing, look in File, Examples, Libraries, Serial for how to set up the serial port to communicate to and from the PC with the Arduino.

import processing.serial.*;
Serial myPort;  // Create object from Serial class
void setup()
{
String portName = Serial.list()[0];  // replace 0 with the port you are using
 myPort = new Serial(this, portName, 9600);  
}

groundfungus:
The serial setup is completely different for Processing than for Arduino. In Processing, look in File, Examples, Libraries, Serial for how to set up the serial port to communicate to and from the PC with the Arduino.

import processing.serial.*;

Serial myPort;  // Create object from Serial class
void setup()
{
String portName = Serial.list()[0];  // replace 0 with the port you are using
myPort = new Serial(this, portName, 9600); 
}

Thanks man! Kinda confused the diffrence between Processor and arduino right now. Am I right with if i upload a program to the arduino through the arduinoprogram then using Processor to send data to the arduino? For exampel the arduino code is "if letter A is recevied from usb, this happens" then in the Processor program i will send the letter A to the usbport that is picked up by the arduino program?

Becuase arduino and processor is 2 diffrent programs that works seperet just sending data to each other?

You have the idea. Think of it like sending data to and from the Arduino Serial Monitor. It is the same, just going to a different place, though same serial port. You won.t be able to use both at once but you can switch back and forth to debug.