Go to advanced search

by buja
Tue Jun 12, 2018 11:08 am
Forum: C/C++
Topic: Using Hex value in a Calculation
Replies: 3
Views: 316

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: 225

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: 3875

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: 511

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: 334

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: 724

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: 724

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: 1863

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...
by buja
Fri Dec 22, 2017 6:51 pm
Forum: C/C++
Topic: stretch wiringpi
Replies: 24
Views: 2097

Re: stretch wiringpi

wiringPi comes with Raspbian, it is installed by default. You can check if it is there by asking APT (the package manager) and by checking the contents of the directory with the system libraries. [email protected]:~/wiringpi $ apt search wiringpi Sorting... Done Full Text Search... Done wiringpi/stable,now 2....
by buja
Fri Dec 22, 2017 6:09 pm
Forum: C/C++
Topic: stretch wiringpi
Replies: 24
Views: 2097

Re: stretch wiringpi

I think you have to make a choice between the wiringPi from Github and the wiringPi that comes standard with Raspbian.
Choose one, delete the other.
by buja
Fri Dec 22, 2017 1:21 pm
Forum: C/C++
Topic: stretch wiringpi
Replies: 24
Views: 2097

Re: stretch wiringpi

Maybe -lwiringPiDev?
(I came up with this after a quick look in Synaptic to check the installed files)
by buja
Wed Dec 20, 2017 9:09 am
Forum: Troubleshooting
Topic: Execute a python file from Gammu
Replies: 4
Views: 292

Re: Execute a python file from Gammu

The shebang line should go in the python file.
I would keep the .py extension, makes it more clear. You don't need a separate .sh file.
by buja
Wed Dec 20, 2017 5:22 am
Forum: Troubleshooting
Topic: Execute a python file from Gammu
Replies: 4
Views: 292

Re: Execute a python file from Gammu

Does your Python script start with the so called shebang? Example 1: without shebang line. # example1.py print('Run this with the python command') To run example 1 you must give this command: python3 example1.py Example 2: with shebang line, you run this without specifying the Python interpreter on ...
by buja
Mon Dec 18, 2017 6:42 pm
Forum: General discussion
Topic: micro sd keeps becoming corrupt
Replies: 6
Views: 553

Re: micro sd keeps becoming corrupt

It's certainly not normal that (new) SD cards fail often.

I guess the first thing to look at is the power supply. Do you often see lightning bolts on the screen (they indicate low voltage)?
Power failures may damage your SD card.
For a Pi 3 a 2.5 A power supply is recommended.
by buja
Wed Dec 13, 2017 11:51 am
Forum: Python
Topic: SDS021 sleep/wake with python
Replies: 3
Views: 700

Re: SDS021 sleep/wake with python

I hope to receive my SDS021 soon, I am surprised the datasheet does not mention how to go to sleep mode. Maybe is the same as the SDS011 sensor for which I found this datasheet: https://www.google.nl/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&uact=8&ved=0ahUKEwij4azO9YbYAhUCI1AKHRdfA0IQFgg3MAI...
by buja
Mon Dec 11, 2017 7:53 pm
Forum: General discussion
Topic: Help! - I need to launch LXTerminal at startup on the desktop.
Replies: 6
Views: 1564

Re: Help! - I need to launch LXTerminal at startup on the desktop.

To launch LXTerminal at startup on the desktop you must add a line to the autostart file, which is in your personal configuration directory. nano ~/.config/lxsession/LXDE-pi/autostart You should see a couple of lines starting with @, add a line with 'x-terminal-emulator': @lxpanel --profile LXDE-pi ...
by buja
Fri Dec 08, 2017 11:38 am
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 2937

Re: how to update or reinstall wiringPi of either prior installation source

I understand what you mean, but you should not expect that. The examples you mention all have in common that they are easy to use as long as you stick to the use case the makers had in mind, the perfect regular consumer. This consumer should stay inside the box and use the package manager to install...
by buja
Fri Dec 08, 2017 10:03 am
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 2937

Re: how to update or reinstall wiringPi of either prior installation source

System stuff in system folders, user stuff in local folders. wiringPi is wiringPi (analogously similar programs and libs), so why have 2 different install root dirs and 1 extra in a home dir? But after all that wouldn't matter if there was a system GUI dashboard for overview and uninstall functions...
by buja
Sat Dec 02, 2017 9:27 am
Forum: C/C++
Topic: Undefined reference to main / Undefined reference to 'some_function'
Replies: 5
Views: 970

Re: Undefined reference to main / Undefined reference to 'some_function'

What happens if you give this command (fill in your own filenames here): gcc -o main main.c module.c This should produce an executable file with the main , which you can run. Building (=making an executable file) only main.c fails because it contains functions that are defined in module.c, and the c...
by buja
Fri Dec 01, 2017 7:05 pm
Forum: C/C++
Topic: A simple weather/environmental data collector in C
Replies: 10
Views: 1263

Re: A simple weather/environmental data collector in C

Yeah, totally impossible to find something :?: Oh wait, I just ordered a BME 680 from Pimoroni (link: https://shop.pimoroni.com/products/bme680). The description has two links to Github sites, one with a Python library and one with a C library ;) (C library by Bosch, the manufacturer of the sensor)
by buja
Thu Nov 30, 2017 7:03 pm
Forum: Beginners
Topic: Connect to laptop
Replies: 5
Views: 499

Re: Connect to laptop

If with "connect to laptop" you mean controlling the Pi from the laptop: yes that is possible. Here are some useful links: 1. https://www.raspberrypi.org/documentation/remote-access/ 2. https://www.raspberrypi.org/documentation/remote-access/vnc/README.md Link 2 is about VNC. In short: connect your ...
by buja
Thu Nov 30, 2017 7:17 am
Forum: C/C++
Topic: A simple weather/environmental data collector in C
Replies: 10
Views: 1263

Re: A simple weather/environmental data collector in C

Interesting stuff! On your Github page on the CS811 sensor you mention it is not working flawlessly with the Raspberry Pi. The Pi Hut sells this sensor and on their website ( https://thepihut.com/products/adafruit-ccs811-air-quality-sensor-breakout-voc-and-eco2 ) they say: Finally, this chip (CS811)...
by buja
Wed Nov 29, 2017 9:09 pm
Forum: Beginners
Topic: pygame in geany (c) possible?
Replies: 4
Views: 383

Re: pygame in geany (c) possible?

It's really simple (example in Python 2): # Just giving sensorValue some number to work with sensorValue = 105 voltage = sensorValue * 5.0 / 1023.0 print voltage # Or for Python 3: print(voltage) It's not that much different from C. By the way, Geany is just an editor, a nice editor with some handy ...
by buja
Wed Nov 29, 2017 6:09 pm
Forum: Raspbian
Topic: sudo apt-get update fails
Replies: 4
Views: 541

Re: sudo apt-get update fails

Welcome :lol:
by buja
Tue Nov 21, 2017 7:30 am
Forum: General discussion
Topic: Raspberry PI official wireless dongle
Replies: 4
Views: 394

Re: Raspberry PI official wireless dongle

I have a Pi 2B with an official RPi WiFi dongle running Raspbian Stretch. It works without any problems.
In fact, when I upgraded from Jessie to Stretch I did not pay any attention to it, worked right out of the box.

This is my weather station, so it runs 24/7.

Go to advanced search