author
1Instructables143,522Views33CommentsJoined July 10th, 2013

Tell us about yourself!

Complete Your Profile

Achievements

10K+ Views Earned a bronze medal
Arduino Contest
Contest Finalist Runner up in the Arduino Contest
Show 1 More »
  • burstolava commented on burstolava's instructable DIY 360 Degree SODAR Device2 weeks ago
    DIY 360 Degree SODAR Device

    Okay, the UI.pde file deals with setting up the interface and then draw() is a command, like in Arduino main code, which loops continuously. This is responsible for changing the interface while the program is running. console.pde organizes functions and data structures that deal with the console, which is the black text window. When you press any key, the "keyPressed()" command is called in console.pde. Specifically, if you hit "enter", the program calls processCmd(), and attempts to figure out what your command was, and do it. console.pde contains the code that tells the Arduino commands. serial.pde listens for anything the Arduino might send, such as your [distance, angle] signal combinations. serial.pde will add new dots to the total number of dots and when the UI...

    see more »

    Okay, the UI.pde file deals with setting up the interface and then draw() is a command, like in Arduino main code, which loops continuously. This is responsible for changing the interface while the program is running. console.pde organizes functions and data structures that deal with the console, which is the black text window. When you press any key, the "keyPressed()" command is called in console.pde. Specifically, if you hit "enter", the program calls processCmd(), and attempts to figure out what your command was, and do it. console.pde contains the code that tells the Arduino commands. serial.pde listens for anything the Arduino might send, such as your [distance, angle] signal combinations. serial.pde will add new dots to the total number of dots and when the UI.pde calls draw() again, it will see a new dot and display it on the screen.dots.pde is just a data structure to organize the dots that appear and disappear over time, as your sensor detects things. nTree is a data structure for an n-ary tree. We put this in so if you type "sp" and then hit the Tab button, the console will complete it to "speed" automatically.'start', 'stop', and 'clear' are pretty obvious commands. 'speed' and 'rpm' do the same thing, tell you the current speed and if you do something like "speed(x)", it's supposed to change the speed to that rpm. 'move()' is supposed to let you specify the exact angle you want the sensor to be looking at, and the motor will reposition itself to that angle. 'history' is an internal variable for the console, not very useful. As a caveat, because you're not making the project as I've posted it, I can't guarantee these commands are all working as intended, but I've explained what they are supposed to do. Hope this helps make sense of the code.

    View Instructable »
  • burstolava commented on burstolava's instructable DIY 360 Degree SODAR Device4 weeks ago
    DIY 360 Degree SODAR Device

    You could google it to verify, but I'm pretty sure NewPing will work on your motor.The "loop" function iterates constantly, so you don't need an internal for loop. Maybe use global variables to do something like...int iterateAngle = 0;boolean forward = true;void loop() {//all the normal code in the loop functionif(forward){motor.step(1);}else{motor.step(-1);}iterateAngle += 1;if (iterateAngle = 200) {forward = !forward;iterateAngle = 0;}}I do not know what the issue would be with your Processing code, but it would likely be with the serial communication. Whatever the Arduino sends to the Processing code (angle and distance), the Processing code displays it. One suggestion I have is that line #55 of UI.pde guesses that the Arduino is connected at 'Serial.list()[0]', if you have...

    see more »

    You could google it to verify, but I'm pretty sure NewPing will work on your motor.The "loop" function iterates constantly, so you don't need an internal for loop. Maybe use global variables to do something like...int iterateAngle = 0;boolean forward = true;void loop() {//all the normal code in the loop functionif(forward){motor.step(1);}else{motor.step(-1);}iterateAngle += 1;if (iterateAngle = 200) {forward = !forward;iterateAngle = 0;}}I do not know what the issue would be with your Processing code, but it would likely be with the serial communication. Whatever the Arduino sends to the Processing code (angle and distance), the Processing code displays it. One suggestion I have is that line #55 of UI.pde guesses that the Arduino is connected at 'Serial.list()[0]', if you have a bunch of things connected to USB ports on your computer, this might not be true and it would be pulling data from some other instrument attached to your computer.

    View Instructable »
  • burstolava commented on burstolava's instructable DIY 360 Degree SODAR Device1 month ago
    DIY 360 Degree SODAR Device

    For a 4-pin setup, you need to indicate the correct pin numbers in "sodar.ino" lines #5 and #6 (#define TRIGGER_PIN ____). This will depend on how you connected the wiring to the Arduino.I just downloaded Processing3 and ran the "UI" code, it seems fine to me on my Mac. What do you mean by "it goes crazy?"Nothing needs to be changed in the processing code. The code is written to continually rotate in one direction. If you want to go back and forth, you'll have to change the part of the "sodar.ino" file at line 58. Putting in a negative value here will cause the stepper to go the opposite direction.

    View Instructable »
  • burstolava commented on burstolava's instructable DIY 360 Degree SODAR Device4 months ago
    DIY 360 Degree SODAR Device

    It appears as though we did not use it in the final circuit design. Sorry for the confusion.

    View Instructable »
  • burstolava commented on burstolava's instructable DIY 360 Degree SODAR Device7 months ago
    DIY 360 Degree SODAR Device

    For programming the arduino you will need to compile both *.ino files into a single sketch, as they are both required.And yes, the UI will work automatically if the Arduino code is already running.

    View Instructable »
  • burstolava commented on burstolava's instructable DIY 360 Degree SODAR Device10 months ago
    DIY 360 Degree SODAR Device

    Sorry to say, but this won't work. A compiler will overwrite a function when another function has the same name. So only the second function will exist. The variable "buffer" is not initialized in the second function, which would break the program. And even if you fix this, you are only sending the angle to the Processing code, so your data won't visualize correctly. Did you do what I asked in the last comment? If in your Arduino IDE terminal there isn't a number being output, then the motor.getAngle() function is not working for some reason. If a number is being output, then the only other thing I saw in your error was that line 62 was written as "void writeData(float cm, angle)" instead of "void writeData(float cm, float angle)". On GitHub it is written t...

    see more »

    Sorry to say, but this won't work. A compiler will overwrite a function when another function has the same name. So only the second function will exist. The variable "buffer" is not initialized in the second function, which would break the program. And even if you fix this, you are only sending the angle to the Processing code, so your data won't visualize correctly. Did you do what I asked in the last comment? If in your Arduino IDE terminal there isn't a number being output, then the motor.getAngle() function is not working for some reason. If a number is being output, then the only other thing I saw in your error was that line 62 was written as "void writeData(float cm, angle)" instead of "void writeData(float cm, float angle)". On GitHub it is written the correct way, but could this be your issue?

    View Instructable »
  • burstolava commented on burstolava's instructable DIY 360 Degree SODAR Device10 months ago
    DIY 360 Degree SODAR Device

    Alright, your error seems to originate from line 49 and line 54 in sodar.ino where it is saying that it is only getting one argument (cm) when it should be getting two arguments (cm, angle). In both cases the variable angle is being set by motor.getAngle(). My guess is that motor.getAngle() is returning void instead of the current motor angle, possibly because the Arduino and stepper are not communicating correctly. Can you check this? Maybe by putting Serial.print(motor.getAngle()) at line 48?

    View Instructable »
  • burstolava commented on burstolava's instructable DIY 360 Degree SODAR Device10 months ago
    DIY 360 Degree SODAR Device

    This is probably happening because the compiler is trying to use the default Stepper library instead of our edited one. We altered the Stepper library to support some basic angle functions that we wanted to use in this project. As stated in Step 7, you should replace the libraries/Stepper directory with the Stepper folder from our repository. This libraries/Stepper directory should be in the Arduino program files (where the executable is for the actual Arduino program). As a side note, we did not alter any of the default functions in the library, so you do not have to worry about our version messing up your other projects that involve the Stepper library. If this does not work, please let me know.Also, this has been asked before in the comments, so I would like to make this more obvious...

    see more »

    This is probably happening because the compiler is trying to use the default Stepper library instead of our edited one. We altered the Stepper library to support some basic angle functions that we wanted to use in this project. As stated in Step 7, you should replace the libraries/Stepper directory with the Stepper folder from our repository. This libraries/Stepper directory should be in the Arduino program files (where the executable is for the actual Arduino program). As a side note, we did not alter any of the default functions in the library, so you do not have to worry about our version messing up your other projects that involve the Stepper library. If this does not work, please let me know.Also, this has been asked before in the comments, so I would like to make this more obvious in the Instructable itself. Would making Step 7 more descriptive have been helpful or should I add a comment to the Arduino code to remind others to use the Stepper library we edited?

    You'll need to open both files in a single sketch. They are both required.

    View Instructable »
  • burstolava commented on burstolava's instructable DIY 360 Degree SODAR Device10 months ago
    DIY 360 Degree SODAR Device

    You'll need a visualization program called Processing to open the radar UI for this project. In the GitHub files, the code for this is under the folder "UI."See Step 7 for links to Processing. You should be able to run our code and at least see the UI, even if you don't have the rest of the project done yet.

    View Instructable »
  • burstolava commented on burstolava's instructable DIY 360 Degree SODAR Device1 year ago
    DIY 360 Degree SODAR Device

    Hey, so I've downloaded both Processing 2.2.1 and Processing 3.0.2, and the UI seems to work okay on my windows machine. I wrote the tab completion just to make the "console" feel more like a console. But it doesn't have every feature of a console because I wrote this from scratch. If you haven't typed anything, hitting tab will not "complete" because it doesn't know what you are trying to say. But if you type "sp" and then hit the tab key, it should tab complete to "speed."

    View Instructable »
  • burstolava commented on burstolava's instructable DIY 360 Degree SODAR Device1 year ago
    DIY 360 Degree SODAR Device

    Hello! If I'm reading this correctly, you are having issues with the Tab completion in the Processing code? Is the program not completing the tab correctly or the command is not executing correctly? The only software you should need would be from Processing and Arduino to run the code. We've only tested on Linux and Windows though.

    View Instructable »
  • burstolava commented on burstolava's instructable DIY 360 Degree SODAR Device1 year ago
    DIY 360 Degree SODAR Device

    There is a set of comments on this page that parameshwarnp asked me regarding these errors. My responses to his questions and step 7 should be useful in getting your program entirely functional.

    Hi, the accuracy of this device will be entirely dependent upon the PING sensor specifications. The furthest distance measurable by this sensor is ~3 meters, but the PING sensor manual would be a better reference for the sensor accuracy and such.

    View Instructable »