     bk_offset="";
   }
   
+  //if the joints should be oscillating
   if (fAfreq > 0){
     //determine joint positions
     pos[0] = iAmp * sin(fAfreq*t) + 1500 + iF_offset;

void loop(){
  char c, buffer[10];
  String readString, amp, knee_amp, afreq, gait, phase, f_offset, b_offset, fk_offset, bk_offset;
  unsigned int sine_time = 0.05;
    
  while (Serial.available() && readString.length() < 37){
    //delay to allow buffer to fill

/*
This is a program that recieves sine wave parameters from a serial connection in a single string.
The string is parsed and converted into numbers, which are plugged into 8 sine equations to generate
positions for each joint of the robot.
*/

#include <Servo.h>

Servo SB, SF, HB, HF, EB, EF, KB, KF;
int pos[] = {0,1,2,3,4,5,6,7};
unsigned int t = 0;
unsigned long previousMillis = 0;

void setup(){
  //Start serial stream at 115200 baud
