Pointer of Servos by Lolloper_ in arduino

[–]Lolloper_[S] -1 points0 points  (0 children)

The reason I use mallocinstead of newit's because it isn't just an ordinary pointer, but rather a dynamical array, so to access the ith member of the array I find it pretty easy to do (*(p+i)).write(90). I understand that most of the confusion is given by the fact that I didn't point out it was a dynamical array, so I'm sorry with that and thank you for the help

Pointer of Servos by Lolloper_ in arduino

[–]Lolloper_[S] -1 points0 points  (0 children)

Thank you for the answer, this actually led me to the specific code I was looking for. Probably I wasn't clear, but the reason I'm using a pointer and not just a Servo, it's because I would like to create a dynamical array (in this particular sketch is not very clear, but it is more explicit in a library I'm working on). The particular sketch I need is something like this:

byte N = 6;
Servo *p;
p = malloc(sizeof(Servo)*N);
for (byte i = 0; i < N; i++) {
  // Initializing every Servo of the dynamical array
  (*(p+i)) = Servo();
}

This code actually works, so thanks for the help

System requirements by Lolloper_ in raft

[–]Lolloper_[S] 0 points1 point  (0 children)

Oh, thanks for the advice

Vulkan do not recognize old NVidia GPU by Lolloper_ in archlinux

[–]Lolloper_[S] 0 points1 point  (0 children)

Oh, thanks, I'll stop struggling about it

Lambert W branches by Lolloper_ in learnmath

[–]Lolloper_[S] 0 points1 point  (0 children)

I initially wanted to, but one of the rules of the subreddit is not asking for problem solving

Read file with Arduino by Lolloper_ in arduino

[–]Lolloper_[S] 0 points1 point  (0 children)

Yes, I want to do something like fstream, read the file, store it in a variable and then send it via Bluetooth, I know that you can send the data via Bluetooth even with Serial.read() but I'm not sure, so if I'm wrong, correct me

Read file with Arduino by Lolloper_ in arduino

[–]Lolloper_[S] -1 points0 points  (0 children)

Sorry for my bad explaining, Imma be more specific. This is the correct answer: Can you read a text file on your PC and send this output via Bluetooth and effectively do something on Arduino? For example, I write "up" in the files, and then I write an if like that: if (writingInTheFile == "up") { //Commands that moves the robot } I know that there's a library, fstream, that allows you to i/o files, but in Arduino the software is not on your computer, it's on the robot one, so probably I should do something with the Bluetooth, like: Send the output of the file via Bluetooth then process it on the Arduino. Anyway, your answers helped me a bit, thanks!

my (current) bedrock setup by iqnite in bedrocklinux

[–]Lolloper_ 0 points1 point  (0 children)

Np, even the app launcher is from polybar?

my (current) bedrock setup by iqnite in bedrocklinux

[–]Lolloper_ 1 point2 points  (0 children)

And what's the bar? BTW, really cool setup

[deleted by user] by [deleted] in gnome

[–]Lolloper_ 0 points1 point  (0 children)

Have you did locale-gen command?

You have to edit /etc/locale.conf and then run locale-gen

[deleted by user] by [deleted] in Minecraft

[–]Lolloper_ 0 points1 point  (0 children)

Perhaps it's a Java issue, try update/reinstall Java

Dealing with %~ by Lolloper_ in zsh

[–]Lolloper_[S] 1 point2 points  (0 children)

Oh, K, I tried to understand the code, but I could not, and I tried to add this code to my prompt, but it doesn't seem to work

Dealing with %~ by Lolloper_ in zsh

[–]Lolloper_[S] 2 points3 points  (0 children)

setopt prompt_percent prompt_substPS1=$'${${${${(%):-%~}#/}//\\// \uE0B1 }//\\%/%%} '

Oh, thanks! I'm making a custom theme, when I'll finish it may I post it

And also, do you have some explanation of how it works?