Kinetic Sculpture  3.1
Software to Architecture for the Junior Kinetic Sculpture Project
 All Classes Files Functions Variables Macros Pages
Macros | Functions | Variables
Globals.h File Reference
#include "Motor.h"
#include "Ultrasonic.h"
#include "Switch.h"
#include "LEDStrip.h"
#include "Disc.h"

Go to the source code of this file.

Macros

#define RED   255, 0, 0
 
#define GREEN   0, 255, 0
 
#define BLUE   0, 0, 255
 
#define YELLOW   255, 255, 0
 
#define ORANGE   255, 140, 0
 
#define MAGENTA   255, 0, 255
 
#define BLACK   0, 0, 0
 
#define WHITE_FULL   255, 255, 255
 
#define WHITE   255, 255, 135
 
#define WHITE_MEDIUM   128, 128, 67
 
#define WHITE_LOW   64, 64, 34
 
#define WHITE_VERY_LOW   48, 48, 25
 
#define WHITE_VERY_VERY_LOW   32, 32, 17
 

Functions

void setupGlobals ()
 
void frontDiscISR ()
 
void backDiscISR ()
 
Switch bit1Switch (BIT_1_SWITCH_PIN)
 
Switch bit2Switch (BIT_2_SWITCH_PIN)
 
Switch bit3Switch (BIT_3_SWITCH_PIN)
 
Motor rightMotor (RIGHT_MOTOR_DIRECTION_PIN, RIGHT_MOTOR_PWM_PIN, RIGHT_MOTOR_TACHOMETER)
 
Motor leftMotor (LEFT_MOTOR_DIRECTION_PIN, LEFT_MOTOR_PWM_PIN, LEFT_MOTOR_TACHOMETER)
 
LEDStrip ledBacklights (BACKLIGHT_RED_PIN, BACKLIGHT_GREEN_PIN, BACKLIGHT_BLUE_PIN)
 
Ultrasonic ultrasonicSensor (US_TRIGGER, US_ECHO)
 
void easterEgg ()
 

Variables

const int BIT_1_SWITCH_PIN = 63
 
const int BIT_2_SWITCH_PIN = 64
 
const int BIT_3_SWITCH_PIN = 65
 
const int RIGHT_MOTOR_DIRECTION_PIN = 14
 
const int RIGHT_MOTOR_PWM_PIN = 12
 
const int RIGHT_MOTOR_TACHOMETER = 18
 
const int LEFT_MOTOR_DIRECTION_PIN = 15
 
const int LEFT_MOTOR_PWM_PIN = 11
 
const int LEFT_MOTOR_TACHOMETER = 19
 
Disc backDisc & rightMotor
 
Disc frontDisc & leftMotor
 
const int BACKLIGHT_RED_PIN = 6
 
const int BACKLIGHT_GREEN_PIN = 8
 
const int BACKLIGHT_BLUE_PIN = 7
 
const int LED_PIN = 13
 
const int US_TRIGGER = 4
 
const int US_ECHO = 3
 

Detailed Description

Contains all global variables used to control the Kinetic Sculpture

Macro Definition Documentation

#define RED   255, 0, 0

RGB values to display red

#define GREEN   0, 255, 0

RGB values to display green

#define BLUE   0, 0, 255

RGB values to display blue

#define YELLOW   255, 255, 0

RGB values to display yellow

#define ORANGE   255, 140, 0

RGB values to display orange

#define MAGENTA   255, 0, 255

RGB values to diplay magenta

#define BLACK   0, 0, 0

RGB values to diplay black

#define WHITE_FULL   255, 255, 255

RGB values to diplay full white

#define WHITE   255, 255, 135

RGB values to diplay white

#define WHITE_MEDIUM   128, 128, 67

RGB values to diplay white medium

#define WHITE_LOW   64, 64, 34

RGB values to diplay white low

#define WHITE_VERY_LOW   48, 48, 25

RGB values to diplay white very low

#define WHITE_VERY_VERY_LOW   32, 32, 17

RGB values to diplay white very very low

Function Documentation

void setupGlobals ( )

Setup all of the global variables. Begin Serial Communication. Set the LED on the PCB to be an output. Set all of the interrupt service routines.

void frontDiscISR ( )

Front disc tachometer interrupt service routine. Forwards the call to Motor::interruptServiceRoutine

void backDiscISR ( )

Back disc tachometer interrupt service rountine. Forwards the call to Motor::interruptServiceRoutine

Switch bit1Switch ( BIT_1_SWITCH_PIN  )

Switch object that represents bit1

Returns
instance of Switch
Switch bit2Switch ( BIT_2_SWITCH_PIN  )

Switch object that represents bit 2

Returns
instance of Switch
Switch bit3Switch ( BIT_3_SWITCH_PIN  )

Switch that represents bit 3

Returns
instance of Switch

Motor that represents the right motor on the PCB (controls back disc)

Returns
instance of Motor

Motor that represents the left motor on the PCB (controls front disc)

Returns
instance of Motor

LEDStrip that controls the backlighting

Returns
instance of LEDStrip
Ultrasonic ultrasonicSensor ( US_TRIGGER  ,
US_ECHO   
)

Ultrasonic object to interact with the ultrasonic sensor

Returns
instance of Ultrasonic
void easterEgg ( )

Easter egg mode for the Kinetic Sculpture. Does it mean anything?

Variable Documentation

const int BIT_1_SWITCH_PIN = 63

Switch declarationPin that bit1 switch is attached to

const int BIT_2_SWITCH_PIN = 64

Pin that bit2 switch is attached to

const int BIT_3_SWITCH_PIN = 65

Pin that bit3 switch is attached to

const int RIGHT_MOTOR_DIRECTION_PIN = 14

Motor initializationPin that controls the direction of the right motor

const int RIGHT_MOTOR_PWM_PIN = 12

Pin that sends PWM power to the right motor

const int RIGHT_MOTOR_TACHOMETER = 18

Pin that the tachometer for the right motor is attached to

const int LEFT_MOTOR_DIRECTION_PIN = 15

Pin that controls the direction of the left motor

const int LEFT_MOTOR_PWM_PIN = 11

Pin that sends PWM power to the left motor

const int LEFT_MOTOR_TACHOMETER = 19

Pin that the tachometer for the left motor is attached to

Disc backDisc& rightMotor

Disc declarationBack disc object to control the back disc

Disc frontDisc& leftMotor

Front disc object to control the front disc

const int BACKLIGHT_RED_PIN = 6

LEDStrip declarationAttached pin on Arduino that controls red on LEDStrip

const int BACKLIGHT_GREEN_PIN = 8

Attached pin on Arduino that controls green on LEDStrip

const int BACKLIGHT_BLUE_PIN = 7

Attached pin on Arduino that controls blue on LEDStrip

const int LED_PIN = 13

Pin that the red LED on the left corner of the PCB that is attached to

const int US_TRIGGER = 4

Ultrasonic declarationTrigger pin that the ultrasonic sensor is attached to

const int US_ECHO = 3

Echo pin that the ultrasonic sensor is attached to