Go to advanced search

by Paeryn
Wed Mar 22, 2023 1:44 am
Forum: Python
Topic: Printing on the tkinter screen result of mouse click
Replies: 2
Views: 116

Re: Printing on the tkinter screen result of mouse click

I can't accomplish what is in the title unless I give up and generate more code than It took to get this far. Any simple solution will be appreciated. #!/usr/bin/python from tkinter import* import time import datetime win = Tk() win.geometry("1350x950") ca = Canvas(win,width=1350,height=9...
by Paeryn
Tue Mar 21, 2023 11:40 pm
Forum: C/C++
Topic: How to include lib.c and lib.h on my project. "undefined reference" error
Replies: 3
Views: 134

Re: How to include lib.c and lib.h on my project. "undefined reference" error

and where test.c is int main() { return; } And... you should fix your main() to actually return an int. It already does, in C if control reaches the end of main() then the value 0 is implicitly returned. This only applies to main(), not any other function. Quote from the C11 (and C17) standards dra...
by Paeryn
Wed Mar 15, 2023 10:00 pm
Forum: Assistive technology and accessibility
Topic: Scrollbars permanently visible
Replies: 4
Views: 2841

Re: Scrollbars permanently visible

Hi Folks, On bullseye the file explorer scrollbars fade in and out as required. Mostly this is cool, but for some users it would help to keep them visible all the time. Anyone know how to do this please? how would it help ? if your talking touch the whole area is scroll-able, just like your phone o...
by Paeryn
Mon Feb 20, 2023 1:38 am
Forum: General
Topic: Assembly code on RP2040 crashes immediately
Replies: 8
Views: 660

Re: Assembly code on RP2040 crashes immediately

I had somehow hoped that the code was written in unified syntax and that the assembler would be able to automagically translate it into Thumb... UAL was introduced so it would be possible to write one piece of code that could be assembled as either Thumb instructions or A32 instructions with the pr...
by Paeryn
Wed Feb 15, 2023 3:26 pm
Forum: Graphics programming
Topic: Has anyone successfully implemented a software 3D rasterizer on the Raspberry Pi?
Replies: 30
Views: 2677

Re: Has anyone successfully implemented a software 3D rasterizer on the Raspberry Pi?

I think.you'll find NEON is certainly capable of floating point vector operations. In AArch32 NEON is only capable of dealing with single precision floats but in AArch64 it can also deal with double precision. Since NEON registers are 128 bits wide you can have up to 4 SP values (AArch32 & AArc...
by Paeryn
Tue Feb 14, 2023 10:07 pm
Forum: Graphics programming
Topic: Has anyone successfully implemented a software 3D rasterizer on the Raspberry Pi?
Replies: 30
Views: 2677

Re: Has anyone successfully implemented a software 3D rasterizer on the Raspberry Pi?

While there are definitely some things that I can change in the code, such as switching my math code to fixed point to take advantage of integer SIMD (as the ARMv8A has no floating point SIMD), ... I think.you'll find NEON is certainly capable of floating point vector operations. In AArch32 NEON is...
by Paeryn
Sat Feb 11, 2023 10:50 pm
Forum: SDK
Topic: Why so much "inline" ? [SOLVED]
Replies: 321
Views: 12700

Re: Why so much "inline" ? [SOLVED]

ejolson wrote:
Sat Feb 11, 2023 9:53 pm
That's good to know. When choosing the highest optimization level, I wonder whether optimize for size or optimize for speed takes priority.
Looking at the LTO reader it takes the base levels such that:
-Og is equivalent to -O1
-Os and -Oz are equivalent to -O2
-Ofast is equivalent to -O3
by Paeryn
Sat Feb 11, 2023 9:39 pm
Forum: SDK
Topic: Why so much "inline" ? [SOLVED]
Replies: 321
Views: 12700

Re: Why so much "inline" ? [SOLVED]

When using LTO do flags such as -Os get passed to the link editor? I wonder if other flags are needed to minimize the size of the final executable. I wouldn't be surprised if some optimization options, not normally passed on a link line, are required in with GCC with LTO enabled; it's just relaunch...
by Paeryn
Tue Feb 07, 2023 4:01 am
Forum: C/C++
Topic: pigpio does compile normaly with simple g++ but not with cmake
Replies: 6
Views: 841

Re: pigpio does compile normaly with simple g++ but not with cmake

The problem is that -lstdc++fs -lpigpio shouldn't be in CMAKE_CXX_FLAGS. By passing the libraries to link in that variable they will likely be being put before any object files and the linker will only link in symbols from a library if there are already unresolved references to those symbols at the ...
by Paeryn
Tue Jan 31, 2023 1:34 am
Forum: Python
Topic: Python string error, can you help me please?
Replies: 2
Views: 302

Re: Python string error, can you help me please?

def bag_of_words(sentence): sentence_words = clean_up_sentence(sentence) bag = [o] * len(words) As pcmanbob said, telling us what error Python reports is fairly important. As given, I can see a problem with the second line of the bag_of_words function. You set bag to be a list containing o but I ca...
by Paeryn
Mon Jan 30, 2023 1:55 am
Forum: General
Topic: C++ enum addition and conversion in PIO driver code.
Replies: 3
Views: 213

Re: C++ enum addition and conversion in PIO driver code.

The code in the .pio file might be just C but it is emitted as a header file and you #include that header file in C++ (the error states that is compiling PicoI2C.cpp ) so it will be seen by the compiler as C++. C++ doesn't allow automatic casting of ints to enums so you'll need to cast it yourself, ...
by Paeryn
Sat Jan 28, 2023 9:59 pm
Forum: Troubleshooting
Topic: make ... modules_install doesn't copy Linux to SD card
Replies: 8
Views: 226

Re: make ... modules_install doesn't copy Linux to SD card

The reason I didn't continue is also because of this: Even if I did the next four commands and copied the kernel image and device tree blobs, those will be the only files on the SD card and nothing else. It won't be able to boot. You've built and installed the kernel, that is all that page is about...
by Paeryn
Sat Jan 28, 2023 8:33 pm
Forum: Troubleshooting
Topic: make ... modules_install doesn't copy Linux to SD card
Replies: 8
Views: 226

Re: make ... modules_install doesn't copy Linux to SD card

Did you continue after that line? "Next, install the kernel modules onto the SD card:" No, I didn't continue. From the command "sudo cp mnt/fat32/$KERNEL.img mnt/fat32/$KERNEL-backup.img", suppose Linux kernel image is already on the SD card boot partition. I don't think it will...
by Paeryn
Sun Jan 01, 2023 1:12 pm
Forum: Beginners
Topic: Error message from guizero
Replies: 4
Views: 211

Re: Error message from guizero

From the error message given, 1dahful has saved their file as guizero.py . When python loads this file the first command is to import guizero which python will dutifully try to import the file into itself and fail, hence the error message ImportError: cannot import name 'App' from partially initiali...
by Paeryn
Sun Jan 01, 2023 12:49 pm
Forum: Python
Topic: GPIO.OUT calling issue
Replies: 3
Views: 245

Re: GPIO.OUT calling issue

So looking at you code you are using 2 distinct python programs main.py & slaves.py It doesn't look that way to me, slaves.py is just being imported by main.py and not being run separately. The error in slaves.py is because you haven't imported the GPIO module in that file. Each module is its o...
by Paeryn
Thu Dec 15, 2022 1:30 am
Forum: Bare metal, Assembly language
Topic: Bug in GDB disassembly.
Replies: 2
Views: 802

Re: Bug in GDB disassembly.

It looks like in the first instance GDB thinks that it is possibly disassembling ARMv6. Technically those instructions that it decodes as TST all begin x30x which are undefined instructions prior to ARMv7 ARMv6T2 but exist within the TST encoding, that is they say that they are TST instructions whic...
by Paeryn
Tue Dec 13, 2022 1:17 am
Forum: General programming discussion
Topic: wheris crontab
Replies: 5
Views: 763

Re: wheris crontab

To see the actual crontab file(s) you must first become root. The filename will be the username. sudo su cd /var/spool/cron/crontabs But it's not advisable to modify user crontab files directly, you should always use cron to both read and write them. Only /etc/crontab and all the ones in the /etc/c...
by Paeryn
Tue Dec 13, 2022 12:18 am
Forum: General programming discussion
Topic: wheris crontab
Replies: 5
Views: 763

Re: wheris crontab

To see the actual crontab file(s) you must first become root. The filename will be the username. sudo su cd /var/spool/cron/crontabs But it's not advisable to modify user crontab files directly, you should always use cron to both read and write them. Only /etc/crontab and all the ones in the /etc/c...
by Paeryn
Mon Dec 05, 2022 2:39 pm
Forum: Python
Topic: tkinter button colour/pointer issue
Replies: 4
Views: 251

Re: tkinter button colour/pointer issue

I've never used Tk under Windows, was that touched enabled? If so then Windows might handle pointer positions when not touched differently.

Oh well, at least it's sorted.
by Paeryn
Mon Dec 05, 2022 4:40 am
Forum: Python
Topic: tkinter button colour/pointer issue
Replies: 4
Views: 251

Re: tkinter button colour/pointer issue

Hi all, I'm trying to set a Pi Zero 2 up with a small touch screen which will operate remote relays. I'm using tkinter, if you couldn't guess, and have cobbled this code together after following a few guides. I've cut it down to just one button to keep it simple, but they all act the same way. Now,...
by Paeryn
Wed Nov 23, 2022 2:02 am
Forum: SDK
Topic: Working with the RTC
Replies: 30
Views: 1409

Re: Working with the RTC

I tried to set the clock without the sscanf first and that worked, I'm going to have to work out a better way to parse the time and date from user input. I have a thought as to the problem using sscanf to set the values directly is wrong as it works with ints and not the int8_t and int16_t used in ...
by Paeryn
Sat Nov 12, 2022 10:52 pm
Forum: Python
Topic: PIL Image.new() help
Replies: 5
Views: 439

Re: PIL Image.new() help

mode= and size= can be used when passing arguments to PIL.Image.new() if you want. In the error you got from While this one: im = PIL.Image.new(mode="RGB", (200, 200)) Error: SyntaxError: positional argument follows keyword argument (Which I believe is because ,(200,200) looks like someth...
by Paeryn
Thu Nov 10, 2022 9:06 pm
Forum: Off topic discussion
Topic: Up to date Nala installation steps?
Replies: 9
Views: 922

Re: Up to date Nala installation steps?

AFAIK installing the nala .deb deliberately prevents you from installing the scar .deb. The two installations provide the same program so you shouldn't be installing both. The scar .deb should really only be used on Debian Sid as it may rely on packages that are newer than what the current Debian st...
by Paeryn
Thu Nov 03, 2022 7:16 pm
Forum: Bare metal, Assembly language
Topic: Getting segmentation error when using offset addressing mode
Replies: 2
Views: 438

Re: Getting segmentation error when using offset addressing mode

I assume you are running this under linux since you mention segmentation error, if so then you need to map the hardware registers into your process' memory space first. See the glibc function mmap() or the underlying kernel syscall mmap2 . Also, what RPi are you using? As the hardware registers star...
by Paeryn
Mon Oct 24, 2022 9:25 pm
Forum: Python
Topic: Python Class Confusion [solved]
Replies: 2
Views: 319

Re: Python Class Confusion

Hope someone can help me understand what I'm doing wrong here. I create a class and try to set up GPIOZero and callbacks inside the Class's __init__. If I set these up outside the Class pointing to functions *inside* the class, it works fine. But the way I have it here, I get no errors but the func...

Go to advanced search