Go to advanced search

by buja
Tue Oct 16, 2018 3:38 pm
Forum: C/C++
Topic: I am missing some fundamental understanding of C?
Replies: 13
Views: 284

Re: I am missing some fundamental understanding of C?

What does this mean?

Code: Select all

lfb.putpixel(x+test.xoffset,y+test.yoffset,test.data[x][y]);
putpixel looks like a function to me, with 3 arguments, but what does lfd.putpixel() mean? (I don't understand the dot notation here)
by buja
Fri Oct 12, 2018 4:12 pm
Forum: General discussion
Topic: How can you prove raspberry pi 3B+ is suitable for industrial and stamping factory environment?
Replies: 11
Views: 356

Re: How can you prove raspberry pi 3B+ is suitable for industrial and stamping factory environment?

Saw this interesting unit while doing some browsing on Amazon for some in my Christmas shopping list...... This quite an interesting thing if you are looking for industrial applications. Amazon UK is a bit light on information on this, but this link seems to be the manufacturer: https://revolution....
by buja
Mon Oct 08, 2018 5:32 pm
Forum: Python
Topic: Run code on the top of the hour
Replies: 7
Views: 145

Re: Run code on the top of the hour

I don't understand you problem with cron, but I think with cron you would already be done with the job.
by buja
Sun Oct 07, 2018 2:28 pm
Forum: Beginners
Topic: How to I2C in C ?
Replies: 4
Views: 134

Re: How to I2C in C ?

There are several possibilities to use the I2C port in C. I used this information: http://www.raspberry-projects.com/pi/programming-in-c/i2c/using-the-i2c-interface You can also use the GPIO libraries, they have I2C functions built-in. With the GPIO libraries I mean wiringPi (pre-installed on Raspbi...
by buja
Mon Oct 01, 2018 6:23 pm
Forum: Other programming languages
Topic: A compilable basic that uses line numbers for Pi?
Replies: 53
Views: 1965

Re: A compilable basic that uses line numbers for Pi?

Those silly commands come from a time when it made perfect sense to be as short as possible because people used teletype terminals and slow serial connections (75 bits per second or so). Those days are gone, but we still have to deal with this legacy. And frankly, the handful of commands Heater list...
by buja
Thu Sep 27, 2018 7:05 pm
Forum: C/C++
Topic: can not use wiringPi with code blocks
Replies: 3
Views: 205

Re: can not use wiringPi with code blocks

In the terminal commands you switch the LED on and off, but in your program you only switch it on.
So all you need to do is add an instruction to switch the LED off, just like you do on the command line.
by buja
Sun Sep 09, 2018 4:59 pm
Forum: General discussion
Topic: VNC printing ---where is it?
Replies: 13
Views: 500

Re: VNC printing ---where is it?

@scruss: thanks, that did it!
Both options were checked. I unchecked them, checked them again and Applied to be sure the setting was saved, and now it works, I can print from my Pi :)
by buja
Sun Sep 09, 2018 9:55 am
Forum: General discussion
Topic: VNC printing ---where is it?
Replies: 13
Views: 500

Re: VNC printing ---where is it?

DirkS wrote:
Sun Sep 09, 2018 9:49 am
buja wrote:
Sun Sep 09, 2018 9:17 am
but I am puzzled where to set the device URI. Maybe you can help?
Why do you need to set that?
Because of the error message in Jobs overview: "Unable to locate printer "elite.local".
by buja
Sun Sep 09, 2018 9:17 am
Forum: General discussion
Topic: VNC printing ---where is it?
Replies: 13
Views: 500

Re: VNC printing ---where is it?

@picandies: there is no print option in VNC Viewer. The text you mention refers to the print option in the program you are using on your Pi via VNC Viewer, for example a text editor or GIMP, like scruss shows. I agree the text could be more clear about that. Printing from the Pi on a local printer c...
by buja
Thu Sep 06, 2018 10:40 am
Forum: C/C++
Topic: we are trying to use gpio pin as chip select
Replies: 24
Views: 1001

Re: we are trying to use gpio pin as chip select

You have to run you program with superuser privileges.
If your program is called Blinky, try to run it like this:

Code: Select all

sudo ./Blinky
by buja
Tue Sep 04, 2018 6:18 am
Forum: C/C++
Topic: we are trying to use gpio pin as chip select
Replies: 24
Views: 1001

Re: we are trying to use gpio pin as chip select

It could be as easy as this: 1. Menu Build / Set Build Commands The line Build will show something like this: gcc -Wall -o "%e" "%f" -lm 2. Add -lbcm2835 to this line: gcc -Wall -o "%e" "%f" -lm -lbcm2835 3. Build the program again Of course you should have installed the bcm2835 library correctly in...
by buja
Mon Sep 03, 2018 12:59 pm
Forum: C/C++
Topic: we are trying to use gpio pin as chip select
Replies: 24
Views: 1001

Re: we are trying to use gpio pin as chip select

You need to include the bcm2825 library in your build command: -lbcm2835
(I don't have Geany available right now, so I cannot be more specific at the moment).
by buja
Sun Aug 26, 2018 9:11 pm
Forum: Java
Topic: Pi4J Version 1.1 is Released!
Replies: 3
Views: 1169

Re: Pi4J Version 1.1 is Released!

Other users here may have a solution, but it's probably best to contact the author directly via the Google group: http://www.savagehomeautomation.com/contact/
by buja
Sat Aug 25, 2018 5:23 am
Forum: Beginners
Topic: Can I attach this motor directly to gpio safely?
Replies: 4
Views: 264

Re: Can I attach this motor directly to gpio safely?

No, you should not connect the motor directly to the GPIO's.
The motor will draw too much current and that will destroy the Pi.
It's not even a risk, it is a certainty.
by buja
Sun Aug 19, 2018 9:26 pm
Forum: Beginners
Topic: Unable to fetch some archives
Replies: 7
Views: 246

Re: Unable to fetch some archives

I have the same problem the last couple of days.
Trying again later seems to work. How much later? Can be minutes or the next day.
by buja
Mon Aug 13, 2018 6:07 pm
Forum: Automation, sensing and robotics
Topic: Calculate distance traveled with a variable time and speed (Odometer)
Replies: 20
Views: 575

Re: Calculate distance traveled with a variable time and speed

A simple way of doing this is to measure the speed at fixed intervals, every 5 seconds for example. Multiply the speed by the duration and you have to distance traveled during that interval. Add that interval distance to the total and you have the total distance. I assume the speed is constant durin...
by buja
Tue Jun 12, 2018 11:08 am
Forum: C/C++
Topic: Using Hex value in a Calculation
Replies: 3
Views: 397

Re: Using Hex value in a Calculation

If you already have a number as an integer (int), there is no need to convert between decimal and hexadecimal. The only thing you have to do is decide in which format you want to print the number: int a = 0x10; printf("%02x", a); => this prints 10 printf("%02d", a); => this prints 16 The numerical v...
by buja
Thu Mar 29, 2018 5:07 am
Forum: Raspbian
Topic: Raspian on non Raspberry systems...
Replies: 2
Views: 261

Re: Raspian on non Raspberry systems...

So, then, given that Raspian isn't affiliated with the Raspberry Pi Foundation, where IS the proper place to discuss Raspian on non-Raspberry Pi systems? The proper place to discuss Raspbian on non-Raspberry Pi systems is the relevant non-Raspberry Pi forum, the Banana Pi or Orange Pi forum for ins...
by buja
Fri Mar 16, 2018 8:28 am
Forum: Off topic discussion
Topic: Stephen Hawking RIP
Replies: 18
Views: 4058

Re: Stephen Hawking RIP

... It gets worse. Turns out the maximum amount of information you can put into any given volume of space, say your living room, is proportional to its surface area not it's volume. Try to put more in and your living room becomes a black hole! If I translate "information" to "stuff" the analogy bec...
by buja
Sun Feb 04, 2018 5:11 pm
Forum: Troubleshooting
Topic: Libre Calc Crashing on Pi-Zero
Replies: 7
Views: 553

Re: Libre Calc Crashing on Pi-Zero

Is going fully command-line an option? For the spreadsheet you could use SC, a text mode spreadsheet that can be easily installed through apt. Or maybe even better in this case: SC-IM (https://github.com/andmarti1424/sc-im). I haven't used that myself, but it's an improved version of SC, and one of ...
by buja
Sat Jan 13, 2018 7:49 am
Forum: Beginners
Topic: Autorun terminal commands at boot
Replies: 2
Views: 425

Re: Autorun terminal commands at boot

by buja
Thu Jan 11, 2018 5:14 pm
Forum: C/C++
Topic: Timer that counts more than a second
Replies: 7
Views: 793

Re: Timer that counts more than a second

Double.
by buja
Thu Jan 11, 2018 5:13 pm
Forum: C/C++
Topic: Timer that counts more than a second
Replies: 7
Views: 793

Re: Timer that counts more than a second

Seems to be a handy function, alarm(). I made an example program to find out how it works. /* alarm.c */ #include <stdio.h> #include <signal.h> #include <stdlib.h> #include <unistd.h> #define BUF_SIZE 200 static void handler(int sig) { printf("Caught signal\n"); /* UNSAFE - see Section 21.1.2) */ } ...
by buja
Wed Jan 10, 2018 4:34 pm
Forum: Wanted
Topic: WANTED: Conquer the Command Line - Richard Smedley
Replies: 6
Views: 1961

Re: WANTED: Conquer the Command Line - Richard Smedley

The book is available at Amazon UK, but the price is quite high. https://www.amazon.co.uk/Conquer-Command-Line-Richard-Smedley/dp/1908256850/ref=pd_rhf_gw_p_img_5?_encoding=UTF8&psc=1&refRID=7F6BQANDNQYBMC8T0664 Don't forget, soon after releasing this book, Raspbian went from Wheezy to Stretch, maki...

Go to advanced search