Category Archives: Phil

Phil 5.3.12

8:00 – 9:30 ESSO

  • Added my presence to the search for solutions.

9:30 – 4:30 FP

  • Integrate pressures today
  • Run sound from the PC until the Arduino is working? Synth shield (http://shop.moderndevice.com/products/fluxamasynth)
  • The sim is now sending sound ID and volume to the Arduino, and getting pressures!
  • Measuring presures from the force sensors.
  • The board seems to get stuck in the WAITING state occasionally. Added a RESET if there is no character read for 1/2 second.

Phil 5.2.12

8:00 – 4:30 FP

  • And somehow, here we are back at communication libraries. At least I have an existence proof that it *can* work. The serial console is perfectly happy. Which means the Arduino code is happy. It looks like I get to blame Windows.
  • Serial looks more solid today. Need to integrate the classes so that ArduinoSerial does a straight passthrough to SerialPort
  • Code is fixed and in Subversion. Back to Monday’s task of integrating with the sim.
  • Building the outgoing JSON object. It turns out that trying to set an int value using cJSON->valueint doesn’t work. Use cJSON->valuedouble. If it’s an int, the printing will be correct.
    • SoundObject is up and running
    • PressureObject is created and waiting to be populated.
    • Tom is building a connector so that I can interact with the pressure sensors tomorrow.

Phil 5.1.12

8:00 – 5:00 FP

  • Generalize JSON parsing in the sketch
  • Integrate serial communication into the demo. Fail gracefully into a GUI-only system
    • Add sound?
    • Adding DataObjects for sound type & volume (inputs) and pressure (outputs). Done
    • And now the serial code is choking again. It seems to be related to the size of the stream that’s sent up. Looking at that after lunch. First test will be to read on the pc without writing, while having the arduino write at faster and faster rates.
    • I got things to work better, but not as well as the serial console. Found a serial library on google code (http://code.google.com/p/mbsutil/). Going to try to use a few pieces from that ad see if it will work better. Got it to compile. Tomorrow, I’ll try to integrate it…

Phil 4.30.12

8:00 – 4:30 FP

  • Seminar. Last one for the year!
  • SF86 follow up
  • Updated resume
  • Talked to Tom a bit about his preamp problems, and worked out a way to proceed.
  • Looked at the Arduino, but did nothing with it. Back to a normal schedule tomorrow.

Phil 4.28.12

1:00pm – 5:00 FP

  • Brought in some more tools
  • Seeing whether Tom and I can integrate the hardware for the show. Nope – feedback issues in the audio
  • The burn test ran fine for approximately 20 hours at 19.2 kbaud. I’m going to work on creating a separate library and then integrate into the KF hand code.
  • built separate library. Realized that I need to put in the JSON reading code on the PC side. Done.
  • Added string assembly code to arduino JSON library and tested
  • Committed all to Subversion

Phil 4.26.12

9:30 – 4:30 FP

  • Slept as much as possible, hoping to become unsick. I think I feel better today
  • It looks like the serial code is working much better. I was trying to determine the size of character buffer using strlen(). Without a null-terminated string to measure, that just won’t work. Thanks to Tom for pointing this out.
  • Getting the json strings to play nicely with the ajson parser. looks like *no* spaces allowed outside of quotes. This is allowed:
    • {"f1_vol":0.10000,"f2_vol":0.20000,"f3_vol":0.30000,"f4_vol":0.40000,"f5_vol":0.50000,"f1_snd":1,"f2_snd":2,"f3_snd":3,"f4_snd":4,"f5_snd":5},
  • while this is not:
    • { "f1_vol":0.1, "f2_vol":0.2, "f3_vol":0.3, "f4_vol":0.4, "f5_vol":0.5, "f1_snd":1, "f2_snd":2, "f3_snd":3, "f4_snd":4, "f5_snd":5 }
  • Sending and receiving the appropriate json objects. Now let’s try to update and resend. Done and working. A pretty good day.

Phil 4.25.12

8:00 – 4:30 FP

  • Working with my various implementations of JSON
  • Working on the parser for the arduino. It’s a 4 state machine that looks for ‘>>’ to signify a new message and ‘<<‘ to signal the end of a new message. The memory for the string to be processed starts at 128 bytes and gets incremented by 128 bytes each time it runs out of space. Done.
  • Got the parser up on the arduino running, but I seem to have messed up the serial port and made it block. Am able to reset by running the terminal program…
  • Code runs fine on the Arduino when I send the string from the console. Need to figure out what’s wrong with my serial code.

Phil 4.24.12

8:00 – 4:30

  • My lungs have turned into a petri dish. Need to make an appointment to kill these things. Call at 9:00
  • Got an LCD shield for debugging: http://www.diybin.com/products/DFRobot-LCD-Arduino-Shield.html
  • Have a good non-blocking read working
  • Have a block write working
  • Think I’m going to try using JSON for communication – there’s a library for the Arduino
    • Downloaded aJson for Arduino
    • Downloaded cJson which it’s based on for the PC side. Integrating now
    • Had to change the cJSON.c to cJSON.cpp for the compilation to work correctly. This may actually make more sense to make into a static library. Going to play around a bit more before making a decision.

Phil 4.23.12

8:00 – 5:30 FP

Phil 12.20.12

8:00 – FP

  • Installing arduino drivers and generally setting up environment.Done
  • Working on understanding ASCII serial communications
  • Serial echo:
    const unsigned int BAUD_RATE = 9600;
    
    void setup(){
      Serial.begin(BAUD_RATE);
    }
    
    void loop(){
      int numChars = Serial.available();
      if(numChars > 0){
        Serial.print("numChars = [");
        Serial.print(numChars);
        Serial.print("] string = ");
        for(int i = 0; i < numChars; ++i){
          // Serial.read returns the first byte (int?) of incoming serial data
          // available (or -1 if no data is available) - int
          char inp = Serial.read();
          Serial.print(inp);
        }
        Serial.println();
        Serial.println("ready");
      }
    }
  • Turns out that I don’t have Visual Studio here. Talking from C++ will have to wait until this afternoon.
  • The arduino book references arduino-serial.c for example c code. The book’s code is here.

Phil 4.19.12

8:00 – FP

Phil 4.17.12

8:00 – 4:00 FP

  • Moved the texture file name for TexturedCollisionCube to the constructor. I’m going to have multiple cubes to interact with, and need to be able to show different “surfaces’. I need a ‘soft’ looking texture.
  • Found some soft looking textures. Next, I need to have some way of determining what the properties of each type of collision are.
  • Adding CollisionTone class. Nah, I need to integrate that into the FingerIO class. We’ll do that tomorrow. I also want to add some kind of state output. Maybe use the soundText field?

Phil 4.16.12

8:00 – 4:00 FP

  • Dealing with a few left over paper issues. Then on to integrating the code? Otherwise, I’ll work on getting TexturedCollisionCube working and handling rotations.
  • Textures work. Checking through rotations. Fixed! It turns out that I was multiplying the model matrix and the collision matrix in the wrong order. Took a while to find, but it seems to be working nicely now.

Phil 4.13.12

8:30 – 2:30 FP

  • Getting re-acquainted with the rendering code
  • Fixed my base class problem with calling setup in the derived class. Still not sure why I can’t call the subclass from the superclass in C++.
  • Paper is done and submitted!