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

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 ledstate = 0
 
ServoPD panservo (400, 200, PANZERO, PANRANGE)
 
ServoPD tiltservo (300, 100, TILTZERO, TILTRANGE)
 

Macro Definition Documentation

◆ DBGSERIAL

#define DBGSERIAL   Serial

Definition at line 37 of file JeVoisRobotCar1.C.

◆ INLEN

#define INLEN   128

Definition at line 40 of file JeVoisRobotCar1.C.

◆ LEDPIN

#define LEDPIN   17

Definition at line 28 of file JeVoisRobotCar1.C.

◆ LIN1PIN

#define LIN1PIN   2

Definition at line 23 of file JeVoisRobotCar1.C.

◆ LIN2PIN

#define LIN2PIN   21

Definition at line 24 of file JeVoisRobotCar1.C.

◆ LPWMPIN

#define LPWMPIN   3

Definition at line 22 of file JeVoisRobotCar1.C.

◆ PANPIN

#define PANPIN   9

Definition at line 29 of file JeVoisRobotCar1.C.

◆ PANRANGE

#define PANRANGE   60

Definition at line 65 of file JeVoisRobotCar1.C.

◆ PANZERO

#define PANZERO   90

Definition at line 64 of file JeVoisRobotCar1.C.

◆ RIN1PIN

#define RIN1PIN   20

Definition at line 26 of file JeVoisRobotCar1.C.

◆ RIN2PIN

#define RIN2PIN   4

Definition at line 27 of file JeVoisRobotCar1.C.

◆ RPWMPIN

#define RPWMPIN   5

Definition at line 25 of file JeVoisRobotCar1.C.

◆ SERIAL

#define SERIAL   Serial1

Definition at line 34 of file JeVoisRobotCar1.C.

◆ TILTPIN

#define TILTPIN   10

Definition at line 30 of file JeVoisRobotCar1.C.

◆ TILTRANGE

#define TILTRANGE   40

Definition at line 67 of file JeVoisRobotCar1.C.

◆ TILTZERO

#define TILTZERO   70

Definition at line 66 of file JeVoisRobotCar1.C.

Function Documentation

◆ loop()

void loop ( )

◆ motor()

void motor ( long  left,
long  right 
)

Definition at line 223 of file JeVoisRobotCar1.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 JeVoisRobotCar1.C.

Referenced by loop(), and setup().

◆ aout

double aout

Definition at line 53 of file JeVoisRobotCar1.C.

Referenced by loop(), and setup().

◆ aset

double aset

Definition at line 53 of file JeVoisRobotCar1.C.

Referenced by setup().

◆ instr

char instr[INLEN+1]

Definition at line 41 of file JeVoisRobotCar1.C.

Referenced by loop().

◆ ledstate

int ledstate = 0

Definition at line 61 of file JeVoisRobotCar1.C.

Referenced by loop().

◆ leftgain

long leftgain = 655

Definition at line 46 of file JeVoisRobotCar1.C.

Referenced by motor().

◆ panservo

ServoPD panservo(400, 200, PANZERO, PANRANGE) ( 400  ,
200  ,
PANZERO  ,
PANRANGE   
)

Referenced by loop(), and setup().

◆ rightgain

long rightgain = 655

Definition at line 47 of file JeVoisRobotCar1.C.

Referenced by motor().

◆ speed

double speed = 0

Definition at line 58 of file JeVoisRobotCar1.C.

Referenced by loop().

◆ steer

double steer = 0

Definition at line 59 of file JeVoisRobotCar1.C.

Referenced by loop().

◆ TARGW

int TARGW = 300

Definition at line 50 of file JeVoisRobotCar1.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 JeVoisRobotCar1.C.

Referenced by loop(), and setup().

◆ wout

double wout

Definition at line 53 of file JeVoisRobotCar1.C.

Referenced by loop(), and setup().

◆ wset

double wset

Definition at line 53 of file JeVoisRobotCar1.C.

Referenced by setup().