1) write a program using arduino or the development board that measures gravitational acceleration in 3-axes and displays the values on the LCD screen.
The program will do the following:
a) To be run upon initialization (i.e. implement this in the setup() function)
• Initialize the development board
• Sound the buzzer
• Write the message “ACCELEROMETER” on the LCD screen.
• Wait two seconds
• Sound the buzzer
#include <Wire.h>
#include "MMA7660.h"
MMA7660 accelemeter;
int buzzer = 10;
void setup()
{
accelemeter.init();
Serial.begin(9600);
Serial.println("ACCELEROMETER: ");
}
void loop()
{
tone(buzzer,261);
int8_t x;
int8_t y;
int8_t z;
float ax,ay,az;
accelemeter.getXYZ(&x,&y,&z);
delay(500);
tone(buzzer,261);
}
Comments
Leave a comment