wolfmankurd
Track Warrior
I wasn't sure if this was the right section for this but while watching jonathan creek on iplayer I thought I'd make a g-meter I had all the stuff here it is:
It uses a 3.3v arduino mini pro with Atmega386 so loads of room for adding more functions. And a MM7260 (only the x-axis output though it's 3axis so I can add g's during acceleration and falling?!:blink1. Set to 0-1.5g (can also be set to 3g and 6g)
The wiring is self explainitory here's a pic:
The offset there is due to gravity I'm not sure if it's reversed or that's the proper orientation?
I'd imagine this costs more than a g-meter for a car would usually?
Needs a video really to show it off really quite pretty when you wave it about. The USB is just there for power which could be supplied by anything really =]
Edit:
Here's the code =]
It uses a 3.3v arduino mini pro with Atmega386 so loads of room for adding more functions. And a MM7260 (only the x-axis output though it's 3axis so I can add g's during acceleration and falling?!:blink1. Set to 0-1.5g (can also be set to 3g and 6g)
The wiring is self explainitory here's a pic:
The offset there is due to gravity I'm not sure if it's reversed or that's the proper orientation?
I'd imagine this costs more than a g-meter for a car would usually?
Needs a video really to show it off really quite pretty when you wave it about. The USB is just there for power which could be supplied by anything really =]
Edit:
Here's the code =]
#include <LiquidCrystal.h>
const int x=0;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
pinMode(x,INPUT);
lcd.begin(16, 2);
lcd.print(" -=Gmeter=- ");
}
void loop() {
int v=map(analogRead(x),0,1023,0,16);
int i=0;
if(v<8){
while(i<v){
lcd.print(" ");
i++;
}
while(i<8){
lcd.print("#");
i++;
}
lcd.print(" ");
}else if(v>8){
i=8;
lcd.print(" ");
while(i<v){
lcd.print("#");
i++;
}
while(i<8){
lcd.print(" ");
i++;
}
}
delay(100);
lcd.setCursor(0,1);
lcd.print(" ");
lcd.setCursor(0,1);
}
Last edited: