add lookup table
This commit is contained in:
parent
44d4f855c6
commit
535194bcb4
9 changed files with 3308 additions and 2 deletions
|
@ -13,6 +13,7 @@
|
|||
extern "C" {
|
||||
#include "rest-engine.h"
|
||||
#include "dev/servo.h"
|
||||
#include "klin.h" // linera values lookup table
|
||||
|
||||
extern resource_t res_poti, res_battery;
|
||||
uint8_t poti_pin = A5;
|
||||
|
@ -54,6 +55,7 @@ void loop (void)
|
|||
int value;
|
||||
poti_voltage = analogRead(poti_pin);
|
||||
value=scale (345,868,servo_min,servo_max,poti_voltage);
|
||||
servo_set(1,value);
|
||||
uint16_t lookup_Daumengas(uint16_t i);
|
||||
servo_set(1,lookup_Daumengas(value));
|
||||
printf("%d,%d\n",poti_voltage,value);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue