JeVois Tutorials  1.22
JeVois Smart Embedded Machine Vision Tutorials
 
Share this page:
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
JeVoisRobotCar2.C File Reference
#include <PID_v1.h>
#include <Servo.h>
Include dependency graph for JeVoisRobotCar2.C:

Go to the source code of this file.

Classes

class  ServoPD
 

Macros

#define LPWMPIN   3
 
#define LIN1PIN   2
 
#define LIN2PIN   21
 
#define RPWMPIN   5
 
#define RIN1PIN   20
 
#define RIN2PIN   4
 
#define LEDPIN   17
 
#define PANPIN   9
 
#define TILTPIN   10
 
#define SERIAL   Serial1
 
#define DBGSERIAL   Serial
 
#define INLEN   128
 
#define PANZERO   90
 
#define PANRANGE   60
 
#define TILTZERO   70
 
#define TILTRANGE   40
 
#define HANDOFFW   ((TARGW * 5) / 10)
 

Functions

void setup ()
 
void loop ()
 
void motor (long left, long right)
 

Variables

char instr [INLEN+1]
 
long leftgain = 655
 
long rightgain = 655
 
int TARGW = 300
 
double wset
 
double win
 
double wout
 
double aset
 
double ain
 
double aout
 
double speed = 0
 
double steer = 0
 
int steerdelay = 0
 
int currid = -1
 
int currw = 0
 
int currt = 0
 
int nextid = -1
 
int nextw = 0
 
int nextt = 0
 
int doneid = -1
 
int t = 0
 
ServoPD panservo (100, 50, PANZERO, PANRANGE)
 
ServoPD tiltservo (300, 100, TILTZERO, TILTRANGE)
 

Macro Definition Documentation

◆ DBGSERIAL

#define DBGSERIAL   Serial

Definition at line 37 of file JeVoisRobotCar2.C.

◆ HANDOFFW

#define HANDOFFW   ((TARGW * 5) / 10)

Definition at line 70 of file JeVoisRobotCar2.C.

◆ INLEN

#define INLEN   128

Definition at line 40 of file JeVoisRobotCar2.C.

◆ LEDPIN

#define LEDPIN   17

Definition at line 28 of file JeVoisRobotCar2.C.

◆ LIN1PIN

#define LIN1PIN   2

Definition at line 23 of file JeVoisRobotCar2.C.

◆ LIN2PIN

#define LIN2PIN   21

Definition at line 24 of file JeVoisRobotCar2.C.

◆ LPWMPIN

#define LPWMPIN   3

Definition at line 22 of file JeVoisRobotCar2.C.

◆ PANPIN

#define PANPIN   9

Definition at line 29 of file JeVoisRobotCar2.C.

◆ PANRANGE

#define PANRANGE   60

Definition at line 64 of file JeVoisRobotCar2.C.

◆ PANZERO

#define PANZERO   90

Definition at line 63 of file JeVoisRobotCar2.C.

◆ RIN1PIN

#define RIN1PIN   20

Definition at line 26 of file JeVoisRobotCar2.C.

◆ RIN2PIN

#define RIN2PIN   4

Definition at line 27 of file JeVoisRobotCar2.C.

◆ RPWMPIN

#define RPWMPIN   5

Definition at line 25 of file JeVoisRobotCar2.C.

◆ SERIAL

#define SERIAL   Serial1

Definition at line 34 of file JeVoisRobotCar2.C.

◆ TILTPIN

#define TILTPIN   10

Definition at line 30 of file JeVoisRobotCar2.C.

◆ TILTRANGE

#define TILTRANGE   40

Definition at line 66 of file JeVoisRobotCar2.C.

◆ TILTZERO

#define TILTZERO   70

Definition at line 65 of file JeVoisRobotCar2.C.

Function Documentation

◆ loop()

void loop ( )

◆ motor()

void motor ( long  left,
long  right 
)

Definition at line 258 of file JeVoisRobotCar2.C.

References leftgain, LIN1PIN, LIN2PIN, LPWMPIN, rightgain, RIN1PIN, RIN2PIN, and RPWMPIN.

Referenced by loop(), and setup().

◆ setup()

void setup ( )

Variable Documentation

◆ ain

PID apid& ain

Definition at line 53 of file JeVoisRobotCar2.C.

Referenced by loop(), and setup().

◆ aout

double aout

Definition at line 53 of file JeVoisRobotCar2.C.

Referenced by loop(), and setup().

◆ aset

double aset

Definition at line 53 of file JeVoisRobotCar2.C.

Referenced by setup().

◆ currid

int currid = -1

Definition at line 69 of file JeVoisRobotCar2.C.

Referenced by loop().

◆ currt

int currt = 0

Definition at line 69 of file JeVoisRobotCar2.C.

Referenced by loop().

◆ currw

int currw = 0

Definition at line 69 of file JeVoisRobotCar2.C.

Referenced by loop().

◆ doneid

int doneid = -1

Definition at line 69 of file JeVoisRobotCar2.C.

Referenced by loop().

◆ instr

char instr[INLEN+1]

Definition at line 41 of file JeVoisRobotCar2.C.

Referenced by loop().

◆ leftgain

long leftgain = 655

Definition at line 46 of file JeVoisRobotCar2.C.

Referenced by motor().

◆ nextid

int nextid = -1

Definition at line 69 of file JeVoisRobotCar2.C.

Referenced by loop().

◆ nextt

int nextt = 0

Definition at line 69 of file JeVoisRobotCar2.C.

Referenced by loop().

◆ nextw

int nextw = 0

Definition at line 69 of file JeVoisRobotCar2.C.

Referenced by loop().

◆ panservo

ServoPD panservo(100, 50, PANZERO, PANRANGE) ( 100  ,
50  ,
PANZERO  ,
PANRANGE   
)

Referenced by loop(), and setup().

◆ rightgain

long rightgain = 655

Definition at line 47 of file JeVoisRobotCar2.C.

Referenced by motor().

◆ speed

double speed = 0

Definition at line 58 of file JeVoisRobotCar2.C.

Referenced by loop().

◆ steer

double steer = 0

Definition at line 59 of file JeVoisRobotCar2.C.

Referenced by loop().

◆ steerdelay

int steerdelay = 0

Definition at line 60 of file JeVoisRobotCar2.C.

Referenced by loop().

◆ t

int t = 0

Definition at line 71 of file JeVoisRobotCar2.C.

Referenced by loop().

◆ TARGW

int TARGW = 300

Definition at line 50 of file JeVoisRobotCar2.C.

Referenced by setup().

◆ tiltservo

ServoPD tiltservo(300, 100, TILTZERO, TILTRANGE) ( 300  ,
100  ,
TILTZERO  ,
TILTRANGE   
)

Referenced by loop(), and setup().

◆ win

PID wpid& win

Definition at line 53 of file JeVoisRobotCar2.C.

Referenced by loop(), and setup().

◆ wout

double wout

Definition at line 53 of file JeVoisRobotCar2.C.

Referenced by loop(), and setup().

◆ wset

double wset

Definition at line 53 of file JeVoisRobotCar2.C.

Referenced by setup().