Pages: 1 [2]   Go Down
Author Topic: Digital imput via arduino to processing  (Read 2911 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 291
Posts: 25874
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quite so
Mein Luftkissenfahrzeug ist mit Aalen gefüllt
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How about answering my questions in reply #14.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Mein Luftkissenfahrzeug ist mit Aalen gefüllt

Sie haben schöne Oberschenkel.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, was bad coment, now I changed. How now ?

So far I haven't seen a single line of code that you have posted with the [ code ] tags as we have repeatedly requested. You want people to help you but are not prepared to take a couple of minutes to work out how to do that.

Your comments do not agree with the code you post. That shows a lack of attention to detail. Detail is what makes programs work. The computer cannot read your mind, nor can we. Code like this (bearing in mind the comments) show a total confusion on your part:

Quote
Code:
int switchPin = 4;                       // Switch connected to pin 4
...
  pinMode(switchPin, INPUT);      // Set pin 0 as an input

Meanwhile comments like this, while correct:

Quote
Code:
  if (val == 2) {              // If the serial value is 2,

... simply do not add anything at all to the code.

Imagine if I said this:

Code:
if (a == 2)   // if a is 2

What has the comment done? Has it helped in any way?

Or this:

Code:
a = 42;   // make a have the value 42

Try to think clearly. Programming is not about writing "stuff that looks like programs". It is about understanding what you are doing.
Logged

Pages: 1 [2]   Go Up
Jump to: