Skip to content
Snippets Groups Projects
Commit a64d09fa authored by Joseph Schaefer's avatar Joseph Schaefer
Browse files

Upload New File

parent f266a5bc
No related branches found
No related tags found
No related merge requests found
#include "helper.h"
void enableINT6(){
EICRB |= (0x1 << ISC60);
EICRB &= ~(0x1 << ISC61);
EIMSK |= (0x1 << INT6);
}
void disableINT6(){
EIFR |= (0x1 << INTF6);
EIMSK &= ~(0x1 << INT6);
}
void triggerINT6(){
INT6_vect();
}
int processTrigR(){
long result = Serial.parseInt(SKIP_ALL);
if(result >= 0 && result < resolution){
//sprintf(message,"Red trigger is now on segment %i",result);
//Serial.print(message);
}
else{
//Serial.print(
// "WARNING: The Red trigger is out of range and may never fire"
// );
}
Serial.print(result);
return result;
}
int processTrigG(){
long result = Serial.parseInt(SKIP_ALL);
if(result >= 0 && result < resolution){
//sprintf(message,"Green trigger is now on segment %i",result);
//Serial.print(message));
}
else{
//Serial.print(
// "WARNING: The green trigger is out of range and may never fire"
// );
}
Serial.print(result);
return result;
}
int processTrigB(){
long result = Serial.parseInt(SKIP_ALL);
if(result >= 0 && result < resolution){
//sprintf(message,"Blue trigger is now on segment %i",result);
//Serial.print(message));
}
else{
//Serial.print(
// "WARNING: The Blue trigger is out of range and may never fire"
// );
}
Serial.print(result);
return result;
}
unsigned processPrescaler(){
long result = Serial.parseInt(SKIP_ALL);
if(result >= 0 && result <= 1024){
switch(result){
case 0:
return PRESCALER0;
break;
case 1:
return PRESCALER1;
break;
case 8:
return PRESCALER8;
break;
case 64:
return PRESCALER64;
break;
case 256:
return PRESCALER256;
break;
case 1024:
return PRESCALER1024;
break;
default:
Serial.print("!");
return -1;
break;
}
}
Serial.print(result);
}
int processMaxFrames(){
long result = Serial.parseInt(SKIP_ALL);
if(result > 0 && result <= UINT_MAX){
return result;
//sprintf(message,"Frame limit is now %i",result);
//Serial.print(message));
}
else{
Serial.print("!");
return -1;
}
Serial.print(result);
}
int processResolution(){
long result = Serial.parseInt(SKIP_ALL);
if(result > 0 && result <= UINT_MAX){
return result;
//sprintf(message,"Reesolution is now %i",result);
}
else{
Serial.print("!");
return -1;
}
Serial.print(result);
}
int processCMRA(){
long result = Serial.parseInt(SKIP_ALL);
if(result > 0 && result <= UINT_MAX){
return result;
//sprintf(message,"cmra is now %i",result);
//Serial.print(message));
}
else{
Serial.print("!");
return -1;
}
Serial.print(result);
}
int processCMRB(){
long result = Serial.parseInt(SKIP_ALL);
if(result > 0 && result <= UINT_MAX){
return result;
//sprintf(message,"cmrb is now %i",result);
}
else{
Serial.print("!");
}
return -1;
Serial.print(result);
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment