I am trying to solve a what I'm sure is a very basic Arduino2Max problem. I have a force sensitive resistor connected, via a breadboard, to an Arduino BT w/AT Mega 328. I had spent a lot of time just getting the program loaded onto the Arduino, but seem to have finally managed that now. I have uploaded the arduino2max.pde file to the arduino . All I would like to do is read data from Analog port 0, and have this displayed on the standard max patch.
Can anybody see where I am going wrong? I believe that the set up of the breadboard is correct, but if you would be so kind to double check then that would be fantastic - this really isn't my area of expertise. I am not sure at what stage of the project the problem is occuring - it could be that the breadboard is fine, but interfacing with max via bluetooth is the issue.
I am using a 10k ohm resistor. I also changed the last line of the programming code to Serial.write(32); as it Arduino could not understand 'BYTE', although I am not sure what the best value to put in here would be. The max patch has the serial reader linked to ARDUINOBT-Bluetoothseri and the correct port has been selected. I am at my wits end as I'm sure it's a small issue that I am overlooking!
Also worth a look - this is the circuit that I am trying to follow: FSR Sensor tutorial (the part titled analog voltage reading method).
I have tried attaching an image of the breadboard but it wont upload for some reason - perhaps if someone could tell me how to do this, then it can shed light on the breadboard set up I have going on.
I have the 9v terminal connected to the left leg of the FSR. the right leg is connected to a 10 kOhm resistor, which is connected to ground. the right leg is also connected to analog ).
armagideontime, I don't know about the other readers, but from your post, I didn't even understand what/where the problem you are seeing is. Please clarify what exactly didn't work? In other words, you explained what you did with the FSR setup, etc., but what did you see?
Also, when you say 9V terminal, how are you supplying this 9V?
suggestions: Develop your code just using a pot connected to the arduino. Setup your FSR using a multimeter. When both are operating as desired, then try combining the two. Not sure what the function of a 9v battery would be.
giantsfan3, zoomkat: thanks for your responses. Firstly, apologies - that was meant to say 5V not 9V, as in the 5V terminal from the Arduino BT supplied from the battery pack.
I will try to clarify: The primary issue is that when pressure is applied to the FSR, there is not analog output being read by my Max patch ( the standard Arduino2Max patch). This may be down to secondary problems, namely incorrect circuit construction, computer-arduino bluetooth error or programming code error.
The link that I uploaded is taken from a relevant tutorial and contains the schematic of the breadboard set up that I am attempting to follow. The picture that I have uploaded shows my attempt at this, something that I believe to be correct, but it would be appreciated if this could be double checked as I am not very strong with circuits - perhaps this is the issue.
I believe that I have paired the Arduino with my laptop (Macbook Pro OSX 10.6.8), although 'ARDUINOBT' does not appear on the devices section of the bluetooth dropdown. Furthermore, there is a red circle by it when I investigate the bluetooth system preferences. I wonder if this is a normal occurrence?
Lastly, it may be an issue with the programming code. However, this code has been taken directly from the Arduino2Max link and is exactly the same, except for the last line which has been altered to 'Serial.write(32)' since 'BYTE' is no longer supported in Arduino 1.0. I have successfully uploaded this to the Arduino, so I don't believe that the problem is here.
If either of you, or anyone else for that matter, can see where the project is breaking down then please let me know! I have tried all sorts of chopping and changing, and feel certain that it's a tiny error that I am making in this process.
This is how I would try to isolate the problem, because it seems very vague at this point:
First, WITHOUT using Arduino2Max, but instead just using the most basic config with the ArduinoBT (http://arduino.cc/en/Guide/ArduinoBT), verify the working status of your ArduinoBT and your Mac's communication with it... In other words, upload and run a simple sketch with a Serial.println("abc") or an LED-Blink, and check that the LED blinks or that the Serial terminal on your Mac is printing "abc").
Next, verify that your FSR itself is working (using a multimeter). Read the section on the ladyada/adafruit page that said "Testing your FSR".
Next, verify the working status of the Arduino2Max: upload a simple program with a Digital read of a pushbutton connected on one of the Digital pins, or a simple Analog read on an Analog pin while leaving the pin just open.
Report back for what happens with each of the above steps, isolated, and that will help fix the problem.
Also, try to upload a clearer/zoomed-in picture (or multiple pictures) of your circuit layout.