Offline
Newbie
Karma: 0
Posts: 7
|
 |
« on: April 28, 2011, 04:54:28 pm » |
Me need a little help with arduino. https://rapidshare.com/files/459673763/Mill_s.zip - here is processing code . Prosessing working it together with Procesing per serial port. Problem - I lose aduino code. Who can help write it code. I am bigner in programming. In arduino is just button input. And all program is similar to this : http://www.geschoir.de/ coffee flourmill.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #1 on: April 29, 2011, 12:01:26 am » |
who can help me. If you want i can take more information
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #2 on: April 29, 2011, 10:53:24 am » |
I tryed this, but not working : // pushbutton sender
int pbutton = 7; int lbutton = 8; int value = 0;
void setup() { pinMode(pbutton, INPUT); Serial.begin(9600); }
void loop() { value = digitalRead(pbutton); if (value == HIGH) { Serial.println("1"); } value = digitalRead(lbutton); if (value == HIGH) { Serial.println("0"); } }
and writing: java.lang.StringIndexOutOfBoundsException: String index out of range: -2 java.lang.StringIndexOutOfBoundsException: String index out of range: -2 java.lang.StringIndexOutOfBoundsException: String index out of range: -2 java.lang.StringIndexOutOfBoundsException: String index out of range: -2
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19001
I don't think you connected the grounds, Dave.
|
 |
« Reply #3 on: April 29, 2011, 11:04:49 am » |
That's not Processing code - that's Arduino.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19001
I don't think you connected the grounds, Dave.
|
 |
« Reply #5 on: April 29, 2011, 11:17:52 am » |
There's nothing wrong with the Arduino code you posted.
What's the problem?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19001
I don't think you connected the grounds, Dave.
|
 |
« Reply #6 on: April 29, 2011, 11:49:06 am » |
The code you posted compiles. It is missing a pinMode for lbutton, but beyond that, I can't see very much wrong with it, that a pull-up or pull-down would not cure.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19001
I don't think you connected the grounds, Dave.
|
 |
« Reply #7 on: April 29, 2011, 11:54:38 am » |
const int pbutton = 7; const int lbutton = 8;
void setup() { pinMode(pbutton, INPUT); pinMode(lbutton, INPUT); // maybe enable the pull-ups here Serial.begin(9600); }
void loop() { int value = digitalRead(pbutton); if (value == HIGH) { Serial.println("1"); } value = digitalRead(lbutton); if (value == HIGH) { Serial.println("0"); } }
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
'round the world...
Offline
Edison Member
Karma: 19
Posts: 2305
|
 |
« Reply #8 on: April 29, 2011, 01:25:50 pm » |
I think a little english lessons are in order here.  I read through this and couldn't figure out what you wanted.
|
|
|
|
|
Logged
|
Eu não sou o teu criado. Se respondo no fórum é para ajudar todos mediante a minha disponibilidade e disposição. Responder por mensagem pessoal iria contra o propósito do fórum e por isso evito-o. Se realmente pretendes que eu te ajude por mensagem pessoal, então podemos chegar a um acordo e contrato onde me pagas pela ajuda que eu fornecer e poderás então definir os termos de confidencialidade do meu serviço. De forma contrária toda e qualquer ajuda que eu der tem de ser visível a todos os participantes do fórum (será boa ideia, veres o significado da palavra fórum). Nota também que eu não me responsabilizo por parvoíces escritas neste espaço pelo que se vais seguir algo dito por mim, entende que o farás por tua conta e risco.
Dito isto, mensagens pessoais só se forem pessoais, ou seja, se já interagimos de alguma forma no passado ou se me pretendes convidar para uma churrascada com cerveja (paga por ti, obviamente).
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19001
I don't think you connected the grounds, Dave.
|
 |
« Reply #9 on: April 29, 2011, 03:51:56 pm » |
What is wrong with the Arduino code?
I don't want to sound repetitive, but you're the one with the hardware, so tell us what you think isn't working.
Tell us what you think "working" means, and how what you observe is different from that definition.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
|