0% found this document useful (0 votes)
11 views2 pages

código-arduino-EM-I

arduino
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

código-arduino-EM-I

arduino
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Comando do Arduino sensor Acelerômetro (MMA 7361)

void setup()

Serial.begin(9600);

void loop()

int analogPin0 = 0;

int sensor1 = analogRead(analogPin0);

int sensor2 = analogRead(analogPin0);

int sensor3 = analogRead(analogPin0);

int sensor4 = analogRead(analogPin0);

int sensor5 = analogRead(analogPin0);

int sensor6 = analogRead(analogPin0);

int sensor7 = analogRead(analogPin0);

int sensor8 = analogRead(analogPin0);

int sensor9 = analogRead(analogPin0);

int sensor10 = analogRead(analogPin0);

int mediasensorx = (sensor1 + sensor2 + sensor3 + sensor4 + sensor5 + sensor6 + sensor7 + sensor8 +
sensor9 + sensor10)/10;

float medsensorvolt0 = (mediasensorx*5.00/1023 - 1.59);

float acelx = medsensorvolt0*9.81/0.78;

float tempo = 0;

tempo = millis ();

tempo = tempo/1000;

Serial.print(" ");

Serial.print(tempo);
Serial.print(" ");

Serial.println(acelx);

delay(50);

You might also like