PART 1: Here is the simple code used to import the potentiometer readings into a graph like data in processing in Arduino and Processing. In the code we revised the input to remap the data to match to the window size.
PART 2: We used a digital input to read data from the Triple Axis Accelerometer Breakout – ADXL345, and a button to complete the Lab this week.
This accelerometer was different then the analog one we used in class. It required a bit more complex code in to complete basic functions of the breakout. The loop in the begining of my arduino code does the following: reads 6 register values from the ADXL345 using the readRegister function – reads the x, y and z acceleration values from the accelerometer and stores them in the buffer named “values” that was created in the beginning section of the sketch. When values are read from the accelerometer they are returned in bytes. They are linked together in a string and printed to the serial terminal. There is a 10ms delay before executing the loop again.