Arduino analog gauge with stepper motor MK2
Вставка
- Опубліковано 18 жов 2016
- Arduino analog gauge with stepper motor let us to code several types of devices: thermometer, tachometer, speedometer, frequency meter etc. Custom gauge faces!
- Наука та технологія
Nice work.
Can this motor do more then one full turn and do you need an encoder?
It can't make full turn, but it don't need an encoder.
Hey Dmitry, what kind of servo is that to move more than 180 degrees ? Thanks :-)
Stepper motor MR1107
My bad! For some reason I thought you were using a servo :-/
Nice gauge !
Hello, wv838!
Here is the code fo ATtiny 85 (Digispark) with Switec X25 library ( github.com/clearwater/SwitecX25 ) and IR sensor. Link to Patreon does not work because I've started new music project: www.patreon.com/RhythmsOfButtocks
#include
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif
// standard X25.168 range 315 degrees at 1/3 degree steps
#define STEPS (315*3)
#define WIRE 4
// For motors connected to pins 0,3,1,2
SwitecX25 Gauge(STEPS,0,3,1,2);
int i, result, pos = 0;
int start_bit = 13000; //Start bit threshold (Microseconds)
int repeat_bit = 11000; //Repeat bit threshold (Microseconds)
int bin_1 = 2000; //Binary 1 threshold (Microseconds)
int bin_0 = 1000; //Binary 0 threshold (Microseconds)
const byte BIT_PER_BLOCK = 32;
int data[BIT_PER_BLOCK];
volatile byte state = LOW;
uint32_t timer;
byte mode = LOW;
void setup(void)
{
Gauge.zero();
pinMode(WIRE, INPUT);
sbi(GIMSK,PCIE); // Turn on Pin Change interrupt
sbi(PCMSK,PCINT4); // Which pins are affected by the interrupt
}
void loop(void)
{
if (state)
{
timer = micros() - timer;
if (timer > start_bit) {i = 0;}
else if (timer < repeat_bit)
{
if(timer > bin_1) //is it a 1?
data[i] = 1;
else if(timer > bin_0) //is it a 0?
data[i] = 0;
i++;
if (i == BIT_PER_BLOCK)
{
result = 0;
for(i = 16; i < 24; i++) {
if(data[i+1] == 1) result |= (1
can you teach how to do ,i need analog rpm gauge diagram
Hi, what transparant housing did you used?
Custom laser cutted case.
Nice project, can you share the code? The patreon link its broken.
Sir, the sketch, please.
hi, what kind of board did you use for this fucking project? hugs from Brazil
Digispark (ATtiny85)
@@Dyr4ik very good! of everything i saw, this was the best! Can you teach me how to do it?