Skip to content

Instantly share code, notes, and snippets.

View SysOverdrive's full-sized avatar
🖼️
Focusing

SysOverdrive

🖼️
Focusing
View GitHub Profile
/*
Controlling a servo position using a potentiometer (variable resistor)
by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>
modified on 8 Nov 2013
by Scott Fitzgerald
http://arduino.cc/en/Tutorial/Knob
*/
// la control la pornire trebe duty cicle sub 6%
/***
//Write a class called MinMaxPrinter. Using a Scanner, ask the user to enter
//a series of integers and find the maximum and the minimum value.
//Use a loop.
//Do not let bad input (a non-integer) terminate your program with an error.
//When the user enters any non-integer, print the maximum and minimun values
//on separate line and quit.
//If the numbers entered are 5 10 3 8 1, 2 9, the output will be
/*
Controlling a servo position using a potentiometer (variable resistor)
by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>
modified on 8 Nov 2013
by Scott Fitzgerald
http://arduino.cc/en/Tutorial/Knob
*/
// la control la pornire trebe duty cicle sub 6%
/***
/*
Controlling a servo position using a potentiometer (variable resistor)
by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>
modified on 8 Nov 2013
by Scott Fitzgerald
http://arduino.cc/en/Tutorial/Knob
*/
// la control la pornire trebe duty cicle sub 6%
/***
/*
Folosim un Potentiometru pentru a simula throthle -ul de pe telecomanda legat la JR connector
ESC NOU SE PORNESTE CU PWM MARE SI CU DE AKA NUC
*/
#include <Servo.h>
Servo myServo; // create servo object to control a servo
/*
Folosim un Potentiometru pentru a simula throthle -ul de pe telecomanda legat la JR connector
ESC NOU SE PORNESTE CU PWM MARE SI DUPA MIC
*/
#include <Servo.h>
#include <Wire.h>
#define SLAVE_ADDRESS 0x04
int number = 0;
int state = 0;
//ENCODER PART------------------
unsigned long timp1, timp2;
float frecventa;
//PINS
//PINS
int outputPinAnalog = 11;
int interuptPin = 3;
//VALUES
unsigned long timp1, timp2;
float frecventa;
int motorValue = 125;//jumatate din viteza
void setup()
int main(void)
{
//Variables
zmq::context_t *ctx;
zmq::socket_t *subSocket;
//Initialise context and connect
ctx = new zmq::context_t(1);
std::string addr = "tcp://127.0.0.1:";
std::string req_port = "5555";
typedef struct center {
center() : x(0), y(0), z(0) {}
int x;
int y;
int z;
MSGPACK_DEFINE(x, y, z);
};
typedef struct normal {