Help a newbie with sending variables from arduino

Have you read @ChrisWard's post?

  • En Designer
    BluetoothClient
    DelimiterByte: 10

i read it before but changed some stuff could be that i erased the important thing, prob is if you say this xD

but that isnt about creating .txt files i think just calling the data

Try simple code first:

int TimesPunched = 0;
int AVGPunchingSpeed = 0;
int AVGPunchingPower = 0;
int delays = 2000;

void setup(){
Serial.begin(9600);
}

void loop() {
TimesPunched=random(1,50);
AVGPunchingSpeed=random(51,100);
AVGPunchingPower=random(100,150);
delays=random(1000,2000);

  Serial.print(TimesPunched);
  Serial.print("|");
  Serial.print(AVGPunchingSpeed);
  Serial.print("|");
  Serial.print(AVGPunchingPower);
  Serial.println();
  delay(delays);
}

My_Punching_DataV4.aia (382.8 KB)

Scroll Screen

1 Like

but the append file should make a new file if your device hasn't got one right? why does it not make any for mine for some reason

Where do you test in MIT Companion or Build (.apk)?

What version of Android does your device have?

When information is saved to a file, if the file does not exist, it is created.

i build the .apk and install it on my phone.

don't know the version of my phone because the lcd crashed yesterday so pretty hard to look. apperently it doesn't like stones.

and i know append should create a new one if it doesn't exist but it doesn't tried it on an older phone with a simpler version by just clicking a button and saving the same data but he doesn't do anything

could the problem be using the labels with saving?

Hi Brum, very briefly, I'm not so well today:

  1. You must have a file component (e.g. File1) before an actual file can be Saved or Appended. The actual file will be created by the Append block if it does not already exist.
  2. The file now has to be saved in the ASD - App Specific Directory. You can best achieve this by using Taifun's File Extension:
    App Inventor Extensions: File | Pura Vida Apps
    .....which can create the path to the ASD. You then postfix your filename to the path, for use with all of the purple file Blocks (Save, Append, Read, Delete).

Does this app work for you?

borrar_create_file.aia (2.3 KB)

get well, hope it's not our beer virus

it sort of works, the read indeed works but i still can't find any .txt file on my phone.

i got the phone connected to my laptop and if i search for the name my_file it doesn't pop up but i can still keep reading an generating numbers to the file. and the phone hasn't got a sd card. and since / stores it to an sd card and not everybody nowadays had a sd card anymore inside their phones i wanted to place it on the phone itself.

but the problem with our project is that you have boxing gloves on so saving must be automaticly after receiving.

When you write: my_file.txt, the file is saved "inside" the application, you cannot see it on the SdCard with a browser.

Read:
http://ai2.appinventor.mit.edu/reference/components/storage.html

If you have an Android <10, try typing:

/my_file.txt

is there any possible way to not saving it to the sd card and not to a private database.

but for example guiding it to a folder within the phone itself

If you have an Android <10 you can save them in:

/sdcard/my_Folder/my_file.txt

If you have an Android> = 10, save it in ASD ...

so if you won't have android >= 10 it won't create the directory and so you can't acces it from the outside?

wouldn't it then be easier to maybe store it to your personal onedrive or some online personal database for example because then all people even with android <10 or iphone can acces their data

You can also save it in TinyWebDB, it is like a database in the cloud.

but that isnt a personal space right?

for example if my teachers punches, I punch and some other guy punches it will all store inside the same database right and you need to really search for your own personal data. or isn't that the case?

https://appinventor.mit.edu/explore/ai2/custom-tinywebdb.html

TinyWebDB is similar to TinyDB,
but the data is stored on an internet server.

Tag: name
ValueToStore: John

thanks for the info but i don't even have a creditcard so pretty hard to do this step xD

but still thanks for all the help either way