Offline
Newbie
Karma: 0
Posts: 22
|
 |
« on: November 30, 2012, 08:33:37 pm » |
What is wrong.
int sensorPinC = A2; int sensorPinA = A0; int sensorPinB = A1; int sensorPinD = A3;// select the input pin for the potentiometer int SPEACKER = 4; int sensorValue = 0; // variable to store the value coming from the sensor
void setup() { pinMode(SPEACKER, OUTPUT); } void loop() { noTone(4); sensorValue = analogRead(sensorPinA); {tone(4, 93, 58); while (sensorValue < 500); delay (100);} noTone(4); sensorValue = analogRead(sensorPinB); { tone(4, 523, 400); while (sensorValue < 500); delay (100); } noTone(4); sensorValue = analogRead(sensorPinC); {tone(4, 49, 80); while (sensorValue < 500); delay (100);} noTone(4); sensorValue = analogRead(sensorPinD); {tone(4, 104, 139); if (sensorValue < 500); delay (100);} }
|
|
|
|
« Last Edit: December 08, 2012, 08:58:10 pm by naturbot »
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 15
Posts: 1003
Arduino rocks
|
 |
« Reply #1 on: November 30, 2012, 08:35:07 pm » |
Where does the setup() function end?
|
|
|
|
|
Logged
|
|
|
|
|
USA, FL
Offline
God Member
Karma: 11
Posts: 580
A life? Where can I download one of those?
|
 |
« Reply #2 on: November 30, 2012, 10:14:26 pm » |
Why did you delete your other post? You are making the same mistakes that you did before. The other post had a ton of feedback on how to fix your code, yet you delete it and start a new thread with the same mistakes...
|
|
|
|
|
Logged
|
//LiNK
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 22
|
 |
« Reply #3 on: November 30, 2012, 10:18:31 pm » |
I fixed that problem now what is wrong.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 22
|
 |
« Reply #4 on: November 30, 2012, 10:21:34 pm » |
Sorry I am new to this I never have been on a forum before now not even Facebook.
|
|
|
|
|
Logged
|
|
|
|
|
USA, FL
Offline
God Member
Karma: 11
Posts: 580
A life? Where can I download one of those?
|
 |
« Reply #5 on: November 30, 2012, 10:24:46 pm » |
No problem. Gotta start somewhere! Not even sure why they let you delete your own posts.. Never seen a forum have that option for regular members.. Take a look at this page. It will get you familiar with the syntax. http://arduino.cc/en/Reference/HomePage
|
|
|
|
|
Logged
|
//LiNK
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 22
|
 |
« Reply #6 on: November 30, 2012, 10:49:49 pm » |
Cant figure it out.
|
|
|
|
|
Logged
|
|
|
|
|
California
Offline
Edison Member
Karma: 38
Posts: 1849
|
 |
« Reply #7 on: November 30, 2012, 10:51:03 pm » |
I fixed that problem now what is wrong.
You don't end your setup function, as was already indicated above.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 22
|
 |
« Reply #8 on: November 30, 2012, 10:57:37 pm » |
O I was looking at my other code that I fixed I did not update this though.
|
|
|
|
|
Logged
|
|
|
|
|
California
Offline
Edison Member
Karma: 38
Posts: 1849
|
 |
« Reply #9 on: November 30, 2012, 11:01:42 pm » |
O I was looking at my other code that I fixed I did not update this though.
So you have code that you have fixed, but it's still "not working" and you aren't going to post it? If you want help, then you need to post your LATEST code in CODE tags, explain what you are wanting it to do, and explain what it is doing now.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 22
|
 |
« Reply #10 on: November 30, 2012, 11:05:27 pm » |
I just did.
|
|
|
|
|
Logged
|
|
|
|
|
California
Offline
Edison Member
Karma: 38
Posts: 1849
|
 |
« Reply #11 on: November 30, 2012, 11:08:01 pm » |
I just did.
Try doing it without the invisible ink.. err pixels, because I don't see any CODE tags or explanations anywhere.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 22
|
 |
« Reply #12 on: November 30, 2012, 11:12:28 pm » |
I thought that adding the other curly bracket would fix it.
|
|
|
|
|
Logged
|
|
|
|
|
California
Offline
Edison Member
Karma: 38
Posts: 1849
|
 |
« Reply #13 on: November 30, 2012, 11:13:11 pm » |
I thought that adding the other curly bracket would fix it.
Fix what? What problem are you having? The latest code that you edited in compiles fine for me so you're going to have to do more than saying "something is wrong" If you're getting an error message post it. If the Arduino is not behaving how you want it, tell us how it's behaving and how you want it to behave. I can spot a few common errors in your sketch that won't throw a compiler error but will likely make it not run as desired, but I'm waiting to here what you are trying to do before I give suggestions on how to fix it.
|
|
|
|
« Last Edit: November 30, 2012, 11:18:46 pm by Arrch »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 22
|
 |
« Reply #14 on: November 30, 2012, 11:17:39 pm » |
I am using a anolog joystick to try to play different notes but it plays the same note over and over again. and that is the code that I just updated.
|
|
|
|
|
Logged
|
|
|
|
|
|