 void send_telemetry() {
 	m_tx_len = hdlc.encode((uint8_t*) &telemetry, sizeof(bc_telemetry_packet_t),
 			m_tx_buffer);
-	Serial3.write(m_tx_buffer, m_tx_len);
+	SERIALDEV.write(m_tx_buffer, m_tx_len);
 }
 
 void setup() {
-	Serial3.begin(57600);
+	SERIALDEV.begin(57600);
 
 	steeringservo.attach(STEERING_PWM_PIN);
 	drivingservo.attach(DRIVE_PWM_PIN);
 
-	analogReference (DEFAULT);
+	analogReference(DEFAULT);
+	analogReadAveraging(16);
+	analogReadResolution(10);
 	pinMode(TEENSY_LED, OUTPUT);
 
 	telemetry.header = BC_TELEMETRY;

#include "communication.h"
#include "Hdlc.h"
#include "mcdriver.h"

#define TEENSY_LED          13
#define IR_LEFT             A9

void loop() {
	toggle_led();

	while (SERIALDEV.available() > 0) {
		m_rx_len = hdlc.decode(SERIALDEV.read());

		// check if HDLC packet is received
		if (m_rx_len > 0) {
