xSnowHeadx / HollowClock

An analog clock with flying hands controlled from internet-time via ESP8266
GNU General Public License v3.0
13 stars 4 forks source link

digit.h #1

Closed Hoskins355 closed 1 year ago

Hoskins355 commented 2 years ago

What library does the digit.h file come from?

xSnowHeadx commented 2 years ago

The file "digit.h" is not used in this project. There are two such files in my other repositories. One in "MinimalClock" written by myself, one in "HariFun_166_Morphing_Clock" written by HariFun. These files are not a part of a library.

Hoskins355 commented 2 years ago

ok thanks let me check again, I did manage to get the clock to work with this

Hoskins355 commented 2 years ago

`//declare variables for the motor pins int motorPin1 = 14; // Blue - 28BYJ48 pin 1 int motorPin2 = 12; // Pink - 28BYJ48 pin 2 int motorPin3 = 13; // Yellow - 28BYJ48 pin 3 int motorPin4 = 15; // Orange - 28BYJ48 pin 4 // Red - 28BYJ48 pin 5 (VCC)

int motorSpeed = 72000; //variable to set stepper speed 1200 * 60 = 72000 int count = 0; // count of steps made int countsperrev = 24555; // number of steps per full revolution int lookup[8] = {B01000, B01100, B00100, B00110, B00010, B00011, B00001, B01001};

////////////////////////////////////////////////////////////////////////////// void setup() { //declare the motor pins as outputs pinMode(motorPin1, OUTPUT); pinMode(motorPin2, OUTPUT); pinMode(motorPin3, OUTPUT); pinMode(motorPin4, OUTPUT); Serial.begin(115200); }

////////////////////////////////////////////////////////////////////////////// void loop(){ clockwise(); // if(count < countsperrev ) // clockwise(); // else if (count == countsperrev * 2) // count = 0; // else // anticlockwise(); // count++; }

////////////////////////////////////////////////////////////////////////////// //set pins to ULN2003 high in sequence from 1 to 4 //delay "motorSpeed" between each pin setting (to determine speed) void anticlockwise() { for(int i = 0; i < 8; i++) { setOutput(i); delayMicroseconds(motorSpeed); } }

void clockwise() { for(int i = 7; i >= 0; i--) { setOutput(i); delayMicroseconds(motorSpeed); } }

void setOutput(int out) { digitalWrite(motorPin1, bitRead(lookup[out], 0)); digitalWrite(motorPin2, bitRead(lookup[out], 1)); digitalWrite(motorPin3, bitRead(lookup[out], 2)); digitalWrite(motorPin4, bitRead(lookup[out], 3)); }`

xSnowHeadx commented 2 years ago

I must confess that I really don't know what you're intend to do. What's wrong with the file "HollowClock.ino" above?