This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
void setup() { | |
// put your setup code here, to run once: | |
Wire.begin(); // join i2c bus (address optional for master) | |
Serial.begin(9600); | |
} | |
int reading = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#define uint8_t unsigned char | |
#define uint16_t unsigned int | |
#define uint32_t unsigned int | |
int main() { | |
int x=33; | |
int y=125; | |
int z=151; | |
uint32_t SenAD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int Horizontal = 0; // set to home position | |
#include <Stepper.h> | |
const int stepsPerRevolution = 512; | |
Stepper Vstepper(stepsPerRevolution, 8, 9, 10, 11); | |
Stepper Ystepper(stepsPerRevolution, 1, 2, 3, 4); | |
// LDR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
10bit Absolute Encoder Gray code decoder Example | |
Codding by www.thaiconverter.com | |
The code is Free of use, feel free to use it ;) | |
We will happy if you use our code to make our World better. | |
*/ | |
boolean pin_state[10]; | |
byte input_pin[] = {2,3,4,5,6,7,8,9,10,11}; // Config Pins Input Here bit-1 to 10 | |
int dec_position = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// include stepper library | |
#include <Stepper.h> | |
const int stepsPerRevolution = 200; // Nema17 motor has 200 steps in 360 degrees rotation | |
// initialize the stepper library on pins 8 through 11: | |
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); // pins 8,9 go to PULL+ & PULL- , pins 10,11 go to DIR+ & DIR- | |
Stepper youStepper(stepsPerRevolution, 2, 3, 4, 5); // pins 8,9 go to PULL+ & PULL- , pins 10,11 go to DIR+ & DIR- | |
int tracknumber = 2; // SET HOW MANY TRACKS YOU WANT UP AND BACK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Stepper.h> | |
char incomingByte; | |
const int stepsPerRevolution = 2000; | |
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); | |
Stepper youStepper(stepsPerRevolution, 2, 3, 4, 5); | |
void setup() { | |
myStepper.setSpeed(800); | |
Serial.begin(9600); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Stepper.h> | |
char incomingByte; | |
const int stepsPerRevolution = 2000; | |
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); | |
Stepper youStepper(stepsPerRevolution, 2, 3, 4, 5); | |
void setup() { | |
myStepper.setSpeed(800); | |
Serial.begin(9600); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Stepper.h> | |
char incomingByte; | |
const int stepsPerRevolution = 2000; | |
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); | |
Stepper youStepper(stepsPerRevolution, 2, 3, 4, 5); | |
void setup() { | |
myStepper.setSpeed(800); | |
Serial.begin(9600); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Stepper.h> | |
char incomingByte; | |
const int stepsPerRevolution = 2000; | |
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); | |
Stepper youStepper(stepsPerRevolution, 2, 3, 4, 5); | |
void setup() { | |
myStepper.setSpeed(800); | |
Serial.begin(9600); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Stepper.h> | |
char incomingByte; | |
const int stepsPerRevolution = 2000; | |
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); | |
Stepper youStepper(stepsPerRevolution, 2, 3, 4, 5); | |
void setup() { | |
myStepper.setSpeed(800); | |
Serial.begin(9600); | |
} |
OlderNewer