From e75fb7c47b640ea329984d95fc9f4b2d7cd3efe4 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sat, 9 Apr 2016 10:56:10 +0200 Subject: because arduino is sooooooo frustrating Signed-off-by: Olivier Gayot --- arduino/sketch_apr09a.ino | 64 ----------------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 arduino/sketch_apr09a.ino (limited to 'arduino/sketch_apr09a.ino') diff --git a/arduino/sketch_apr09a.ino b/arduino/sketch_apr09a.ino deleted file mode 100644 index af05cef..0000000 --- a/arduino/sketch_apr09a.ino +++ /dev/null @@ -1,64 +0,0 @@ -#include "Belt.h" -#include "logs.h" - -Belt::Belt() -{ - _pin_pressure_bottom = 0; - _pin_pressure_top = 1; - _pin_flexion = 2; - _pin_gyro_x = 3; - _pin_gyro_y = 4; - _pin_gyro_z = 5; -} - -void Belt::read_pressure_top() -{ - _pressure_top = analogRead(_pin_pressure_top); -} -void Belt::read_pressure_bottom() -{ - _pressure_bottom = analogRead(_pin_pressure_bottom); -} -void Belt::read_flexion() -{ - _flexion = analogRead(_pin_flexion); -} -void Belt::read_angle_x() -{ - _angle_x = analogRead(_pin_gyro_x); -} -void Belt::read_angle_y() -{ - _angle_y = analogRead(_pin_gyro_y); -} -void Belt::read_angle_z() -{ - _angle_z = analogRead(_pin_gyro_z); -} - -static Belt belt; - -void setup() -{ - Serial.begin(9600); -} - -void loop() -{ - delay(500); - - /* fetch the values from the sensors */ - belt.read_pressure_bottom(); - belt.read_pressure_top(); - belt.read_flexion(); - belt.read_angle_x(); - belt.read_angle_y(); - belt.read_angle_z(); - - serial_printf("PRESSURE_BOTTOM: bottom:%d\n", belt.get_pressure_bottom()); - serial_printf("PRESSURE_TOP:%d\n", belt.get_pressure_top()); - serial_printf("FLEXION:%d\n", belt.get_flexion()); - serial_printf("ANGLE_X:%d\n", belt.get_angle_x()); - serial_printf("ANGLE_Y:%d\n", belt.get_angle_y()); - serial_printf("ANGLE_Z:%d\n", belt.get_angle_z()); -} -- cgit v1.2.3