Hello fellow geeks,i started a little project with Mit App Inventor i want to use a current sensor Module(attached to analog pin A0) with my arduino to display on the android app,now i want to add another value which is power(current X voltage=power) so for that i used this piece of code for the arduino:
void loop() {
float val1 = analogRead(in);
float val2 = val / 205; // the second value i want to recieve on the app
Serial.print(val1)
Serial.print(val2);
delay(400);//Small delay between each data send
}
how can i make the mit app inventor display two values of the same sensor(the current sensor in my case) thank you so much in advance
Hello and welcome to the forum. It's a friendly place and you'll get plenty of guidance.
Your sketch sends the values to the Arduino's hardware serial port. The data will appear on the IDE monitor, unless you have some device connected to pins 0 & 1. Have you thought out how to get the data from the Arduino to your Android device?
When the data is received by the Android device, a simple app can display both values. Can you describe more precisely what you need to know?
thank you so much Brother,it's marvelous to have a welcoming community ! the app|391x500 this is the layout of the app i want to recive the current sensor's readings (from analog pin A0 ) and also mutiply the same value to have the power in watts. i hope i made my point clear, in other words i want to recive the readings as current( raw input of the current sensor).
What you want to achieve is clear and can certainly be done. What is not clear is why you are "confused". You haven't told us what you have already tried or what parts you do not understand.
Do you have the blocks for that app? Do you know how to build an app?