diff --git a/examples/firmware/firmware.ino b/examples/firmware/firmware.ino index 5182763..ce7b3f1 100644 --- a/examples/firmware/firmware.ino +++ b/examples/firmware/firmware.ino @@ -9,7 +9,7 @@ */ -// WIP -> preliminary firmware +// This is the stock firmware of Arduino Alvik robot. #include "Arduino_AlvikCarrier.h" @@ -61,7 +61,6 @@ uint8_t version[3]; void setup(){ - Serial.begin(115200); alvik.begin(); alvik.disableIlluminator(); alvik.setLeds(COLOR_ORANGE); diff --git a/examples/imu/imu.ino b/examples/imu/imu.ino index b162b09..1c96d55 100644 --- a/examples/imu/imu.ino +++ b/examples/imu/imu.ino @@ -20,7 +20,6 @@ unsigned long time_imu_update=0; Arduino_AlvikCarrier alvik; void setup(){ - Serial.begin(115200); alvik.begin(); time_imu_update=millis(); } @@ -28,24 +27,24 @@ void setup(){ void loop(){ if (millis()-time_imu_update>100){ alvik.updateImu(); - Serial.print("\t"); - Serial.print(alvik.getAccelerationX()); - Serial.print("\t"); - Serial.print(alvik.getAccelerationY()); - Serial.print("\t"); - Serial.print(alvik.getAccelerationZ()); - Serial.print("\t"); - Serial.print(alvik.getAngularVelocityX()); - Serial.print("\t"); - Serial.print(alvik.getAngularVelocityY()); - Serial.print("\t"); - Serial.print(alvik.getAngularVelocityZ()); - Serial.print("\t"); - Serial.print(alvik.getRoll()); - Serial.print("\t"); - Serial.print(alvik.getPitch()); - Serial.print("\t"); - Serial.println(alvik.getYaw()); + alvik.serial->print("\t"); + alvik.serial->print(alvik.getAccelerationX()); + alvik.serial->print("\t"); + alvik.serial->print(alvik.getAccelerationY()); + alvik.serial->print("\t"); + alvik.serial->print(alvik.getAccelerationZ()); + alvik.serial->print("\t"); + alvik.serial->print(alvik.getAngularVelocityX()); + alvik.serial->print("\t"); + alvik.serial->print(alvik.getAngularVelocityY()); + alvik.serial->print("\t"); + alvik.serial->print(alvik.getAngularVelocityZ()); + alvik.serial->print("\t"); + alvik.serial->print(alvik.getRoll()); + alvik.serial->print("\t"); + alvik.serial->print(alvik.getPitch()); + alvik.serial->print("\t"); + alvik.serial->println(alvik.getYaw()); } delay(1); } \ No newline at end of file diff --git a/examples/kinematics/kinematics.ino b/examples/kinematics/kinematics.ino index 8a595bc..781bae3 100644 --- a/examples/kinematics/kinematics.ino +++ b/examples/kinematics/kinematics.ino @@ -22,7 +22,6 @@ uint8_t task=0; bool led_value = false; void setup() { - Serial.begin(115200); alvik.begin(); ttask=millis(); tmotor=millis(); @@ -35,17 +34,17 @@ void loop() { tmotor=millis(); alvik.updateMotors(); alvik.updateKinematics(); - Serial.print("\t"); - Serial.print(alvik.getLinearVelocity()); - Serial.print("\t"); - Serial.print(alvik.getAngularVelocity()); - Serial.print("\t"); - Serial.print(alvik.getX()); - Serial.print("\t"); - Serial.print(alvik.getY()); - Serial.print("\t"); - Serial.print(alvik.getTheta()); - Serial.print("\n"); + alvik.serial->print("\t"); + alvik.serial->print(alvik.getLinearVelocity()); + alvik.serial->print("\t"); + alvik.serial->print(alvik.getAngularVelocity()); + alvik.serial->print("\t"); + alvik.serial->print(alvik.getX()); + alvik.serial->print("\t"); + alvik.serial->print(alvik.getY()); + alvik.serial->print("\t"); + alvik.serial->print(alvik.getTheta()); + alvik.serial->print("\n"); } if ((millis()-ttask>5000)||alvik.isTargetReached()){ diff --git a/examples/motor/motor.ino b/examples/motor/motor.ino index 02568ec..6d6230c 100644 --- a/examples/motor/motor.ino +++ b/examples/motor/motor.ino @@ -9,6 +9,8 @@ */ +// This example shows how wheels velocity control can be used + #include "Arduino_AlvikCarrier.h" @@ -21,15 +23,10 @@ int status=0; float reference = 0.0; void setup(){ - Serial.begin(115200); alvik.begin(); t=millis(); t_change=millis(); alvik.setRpm(reference,reference); - - Serial.print("reference"); - Serial.print(" "); - Serial.println("measure"); } void loop(){ @@ -64,11 +61,5 @@ void loop(){ if (millis()-t>20){ t=millis(); alvik.updateMotors(); - - Serial.print(reference); - Serial.print(" "); - Serial.print(alvik.getRpmRight()); - Serial.print(" "); - Serial.println(alvik.getRpmLeft()); } } \ No newline at end of file diff --git a/examples/position/position.ino b/examples/position/position.ino index 68a3669..b7afbb2 100644 --- a/examples/position/position.ino +++ b/examples/position/position.ino @@ -9,6 +9,8 @@ */ +// This example shows how left wheel position control can be used + #include "Arduino_AlvikCarrier.h" @@ -20,7 +22,6 @@ uint8_t task=0; float reference; void setup() { - Serial.begin(115200); alvik.begin(); task = 0; reference = 0; @@ -32,10 +33,6 @@ void loop() { if (millis()-tmotor>20){ tmotor = millis(); alvik.updateMotors(); - Serial.print(reference); - Serial.print("\t"); - Serial.print(alvik.getPositionLeft()); - Serial.print("\n"); } if (millis()-ttask>5000){ diff --git a/library.properties b/library.properties index 95ffe2b..465e1c1 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Arduino_AlvikCarrier -version=0.3.4 +version=0.4.0 author=Arduino, Giovanni di Dio Bruno, Lucio Rossi maintainer=Arduino sentence=Library and firmware for Arduino Alvik Carrier board diff --git a/src/definitions/robot_definitions.h b/src/definitions/robot_definitions.h index 129ba41..6ccf6a7 100644 --- a/src/definitions/robot_definitions.h +++ b/src/definitions/robot_definitions.h @@ -87,8 +87,8 @@ const float MOTION_FX_PERIOD = (1000U / MOTION_FX_FREQ); // Library version #define VERSION_BYTE_HIGH 0 -#define VERSION_BYTE_MID 3 -#define VERSION_BYTE_LOW 4 +#define VERSION_BYTE_MID 4 +#define VERSION_BYTE_LOW 0