Go to advanced search

by Paeryn
Sun Dec 10, 2017 8:47 pm
Forum: C/C++
Topic: Compile errors for GTK/Cairo
Replies: 1
Views: 33

Re: Compile errors for GTK/Cairo

You are following a GTK+2 tutorial but are trying to compile against GTK+3 , one of the main differences is that you cannot directly access the fields in a struct, you have to do a function call, e.g. cr = gdk_cairo_create(widget->window); becomes cr = gdk_cairo_create(gtk_widget_get_window(widget))...
by Paeryn
Sun Dec 10, 2017 12:08 am
Forum: C/C++
Topic: SDL_Image won't display JPEGs
Replies: 11
Views: 1216

Re: SDL_Image won't display JPEGs

Raspbian Stretch has libpng-1.6 (1.6.32 I think off the top of my head), I compiled SDL2-2.0.7 & SDL2_image-2.0.2 without any problems when I checked this png issue (compiled the libraries only, I didn't run any tests). When I have time (& remember) I'll look into the jpeg issue further and see if I...
by Paeryn
Sat Dec 09, 2017 3:57 am
Forum: C/C++
Topic: SDL_Image won't display JPEGs
Replies: 11
Views: 1216

Re: SDL_Image won't display JPEGs

Same problem here, using SDL2_image-2.0.1. Also, SDL2_image-2.0.2 does not compile, it shows a lot of errors trying to find png functions: "IMG_png.c:93:62: error: unknown type name png_inforp" "IMG_png.c:96:29: error: unknown type name png_structrp" ... an so on. I'm compiling SDL2 because raspbia...
by Paeryn
Fri Dec 08, 2017 8:19 pm
Forum: General discussion
Topic: Help me, so many questions!
Replies: 8
Views: 397

Re: Help me, so many questions!

I think Inkscape is nearer to Illustrator than GIMP. Inkscape is vector based whereas GIMP is bitmap based.
by Paeryn
Fri Dec 08, 2017 8:52 am
Forum: Beginners
Topic: Random.Choice and while loop
Replies: 6
Views: 182

Re: Random.Choice and while loop

Your while True: bit as it stands is totally superfluous (the loop, not the contents of the loop) as the code inside the while loop will be executed once and once only (apart from the time.sleep(0.5) at the end of the loop which will never be executed since the break on the line immediately above it...
by Paeryn
Tue Nov 28, 2017 2:13 am
Forum: Other languages
Topic: Rust seems to bring some love to Rpi
Replies: 41
Views: 5768

Re: Rust seems to bring some love to Rpi

I think, the best bet is that Rust or whatever new language the youngn's come up with next can make use of all the existing infrastructure. That is interface and link with C easily. I have no idea if Rust can do that but I presume so. Yes, Rust has a decent FFI so you can call C code from Rust and ...
by Paeryn
Sat Nov 25, 2017 12:29 am
Forum: Python
Topic: Python3 error
Replies: 5
Views: 242

Re: Python3 error

It looks like pygame.camera is hitting that problem, camera.set_controls() is marked as only accepting keywords. Python 2 allowed foreign modules to register functions as just taking keywords (and it behaved as if you also specified varags) but Python 3 changed it so that if you registered a functio...
by Paeryn
Fri Nov 24, 2017 5:04 pm
Forum: Python
Topic: Python3 error
Replies: 5
Views: 242

Re: Python3 error

It might help if you say what Python module/package you are using to access the webcam.
by Paeryn
Wed Nov 22, 2017 7:01 pm
Forum: Beginners
Topic: GCC Coin linux GUI wallet
Replies: 1
Views: 71

Re: GCC Coin linux GUI wallet

That download will be compiled for an Intel/AMD x86/x64 processor, the RPi has an ARM processor. Unless you can get the provider to either make a version for the RPi or give you the source code so you can compile it yourself then you are out of luck.
by Paeryn
Tue Nov 21, 2017 11:30 am
Forum: OpenGLES
Topic: setting colors in shader,
Replies: 3
Views: 139

Re: setting colors in shader,

It's always harder to see when you know what you meant to or originally had put there, the brain is very good at filling in missing details automatically. Strange that the shader compiler didn't complain, I thought it was supposed to be an error to have unused components in a constructor. Maybe that...
by Paeryn
Mon Nov 20, 2017 8:13 pm
Forum: OpenGLES
Topic: setting colors in shader,
Replies: 3
Views: 139

Re: setting colors in shader,

" vec4 c1 = vec4(v_textcolor.xyz, v_textcolor * texture2D(texture_uniform, v_frag_uv).a);\n" This line looks suspect, you've said the fourth component is a vec4 of v_textcolor times the alpha of the texture lookup , so the alpha of c1 will be the red component of that. Did you mean? " vec4 c1 = vec...
by Paeryn
Mon Nov 20, 2017 7:49 pm
Forum: General discussion
Topic: Headphone Jack not working in stretch?
Replies: 8
Views: 271

Re: Headphone Jack not working in stretch?

Chris D wrote:
Mon Nov 20, 2017 6:18 pm
The -o option worked fine from the command line, however, I am using OMXPLAYER from within Python 3.x via the OMXPLAYER WRAPPER.
Looking at the Python OMXPlayer wrapper api it looks like you can easily pass any needed arguments to omxplayer e.g.

Code: Select all

OMXPlayer('path.mp4', args=['-o', 'both'])
by Paeryn
Mon Nov 20, 2017 7:37 pm
Forum: Python
Topic: tkinter
Replies: 4
Views: 214

Re: tkinter

There is a tabbed widget in ttk - ttk.Notebook(), is that of any use to you? That allows you to easily have multiple windows (frames) with one visible at a time. I'm not sure if you can hide the notebook's tab pane though.

https://docs.python.org/3.5/library/tki ... l#notebook
by Paeryn
Fri Nov 17, 2017 2:46 pm
Forum: Bare metal
Topic: as options for security extensions (RPI2)
Replies: 4
Views: 354

Re: as options for security extensions (RPI2)

To get a banked core register from a different bank to what you are currently in you have to use mrs Oh, I was not aware of that, thanks for that hint ! Fixed for now. One point however... does really as knows in which mode the code runs ?? Not sure I understand what you are asking here. You should...
by Paeryn
Fri Nov 17, 2017 12:14 am
Forum: Python
Topic: how to convert an integer to byte(s) in python?
Replies: 11
Views: 427

Re: how to convert an integer to byte(s) in python?

Thanks for the reply. I guess I am still very fuzzy about this in byte. on the pi side I sent an int 180 as one single byte to the serial port in python deg=180 deg_b=deg.to_bytes(1, 'little') print(deg_b) b'\xb4' #result so I assume the byte b'\xb4' is written to the serial port. And when Arduino ...
by Paeryn
Thu Nov 16, 2017 6:44 pm
Forum: Python
Topic: how to convert an integer to byte(s) in python?
Replies: 11
Views: 427

Re: how to convert an integer to byte(s) in python?

The issue here is not really in the Pi side. I had pi send a single byte of an integer 180 to the Arduino. I don't know what to do with the inByte in the Adruino sketch, is the inByte a byte array? I need to use the inByte to determine how many degrees the servo ought to be. How do I do something l...
by Paeryn
Thu Nov 16, 2017 6:03 pm
Forum: Bare metal
Topic: as options for security extensions (RPI2)
Replies: 4
Views: 354

Re: as options for security extensions (RPI2)

You can't specify LR_mon in a subs instruction (or pretty much any instruction other than those that specifically allow access to them). To get a banked core register from a different bank to what you are currently in you have to use mrs to copy it to a register in the current bank (and msr if you w...
by Paeryn
Thu Nov 16, 2017 3:45 pm
Forum: Python
Topic: how to convert an integer to byte(s) in python?
Replies: 11
Views: 427

Re: how to convert an integer to byte(s) in python?

On the Arduino side: void loop() { char inByte = ' '; if(Serial.available()){ // only send data back if data has been sent char inByte = Serial.read(); // read the incoming data if(inByte) my_blink(12); Serial.println(inByte); // send the data back in a new line so that it is not all one long line ...
by Paeryn
Thu Nov 16, 2017 12:45 am
Forum: Python
Topic: how to convert an integer to byte(s) in python?
Replies: 11
Views: 427

Re: how to convert an integer to byte(s) in python?

degree=180 while True: ser.write(str(degree).encode()) #print(ser.readline()) sleep(.5) seems like the degree=180 needs to be converted into a string first, then it needs to be encoded to write to the serial port one byte at a time. After the encode() 128 becomes a b'0xb4', it seems to pass 0xb4 as...
by Paeryn
Wed Nov 15, 2017 11:04 pm
Forum: Python
Topic: how to convert an integer to byte(s) in python?
Replies: 11
Views: 427

Re: how to convert an integer to byte(s) in python?

In Python3 ints have a function to_bytes(length, byteorder, signed=False) that returns an array of bytes (a byte string) of a given length in the given byte order where 'big' means most significant byte first and 'little' means least significant byte first, and whether it is a signed integer where T...
by Paeryn
Wed Nov 15, 2017 9:21 pm
Forum: Beginners
Topic: while loop question
Replies: 16
Views: 551

Re: while loop question

You can also use break to immediately terminate the current loop if you need to do so whilst in the middle of the loop. x = 0 while x < 10: x = x + 1 if x == 5: break print("x = {}".format(x)) print("Goodbye") This will print the numbers 1 to 4 but when it gets to the if x == 5: when x does equal 5 ...
by Paeryn
Wed Nov 15, 2017 9:00 pm
Forum: Python
Topic: from xxx import yyy & from aaaa.xxx import yyyy
Replies: 4
Views: 194

Re: from xxx import yyy & from aaaa.xxx import yyyy

When an import name uses the dotted notation then it is importing a package. There is one important thing about packages in that the directory must have a file named __init__.py in it (two underscores each side of init), it can be an empty file but it must exist for Python to treat that directory as...
by Paeryn
Wed Nov 15, 2017 8:42 pm
Forum: General discussion
Topic: Forum Search
Replies: 29
Views: 900

Re: Forum Search

Is the DDG search just going to be specific to the RPi theme? I only ever use ProSilver (I can't get on with the RPi theme) and that still has the phpBB search (not that I use search much personally).
by Paeryn
Wed Nov 15, 2017 8:18 pm
Forum: OpenVG
Topic: Transparent background
Replies: 11
Views: 1549

Re: Transparent background

Sorry, not updated my fork of libshapes yet (only updated to Stretch last week), you just need to change the library names that it links against. In the Makefile change -lGLESv2 -lEGL to -lbrcmGLESv2 -lbrcmEGL Stretch has libjpeg9 available which is fine (Jessie only had libjpeg8 in the main repo), ...
by Paeryn
Tue Nov 14, 2017 10:45 pm
Forum: Python
Topic: Tkinter in while loop
Replies: 6
Views: 264

Re: Tkinter in while loop

tk.update() AttributeError: module 'tkinter' has no attribute 'update' From the error message it looks like tk is the name you gave when you imported tkinter rather than the name of the top-level widget, e.g. you have something like import tkinter as tk tkroot = tk.Tk() tk.update() ## Should be tkr...

Go to advanced search