Go to advanced search

by Grumpy Mike
Fri Sep 23, 2016 10:13 am
Forum: Python
Topic: Reading two MCP3008 A/Ds
Replies: 7
Views: 1343

Re: Reading two MCP3008 A/Ds

Thanks joan, The trick is to regenerate the variable that holds the data every time you do the SPI call because it writes all over it. The code then:- data = chr(0x1)+chr(0x80)+chr(0) rx = io.wiringPiSPIDataRW(0,data) print rx returns the tantalising [3, '\x00\x01\xa4'] which the last two numbers ar...
by Grumpy Mike
Fri Sep 23, 2016 6:10 am
Forum: Python
Topic: Reading two MCP3008 A/Ds
Replies: 7
Views: 1343

Re: Reading two MCP3008 A/Ds

Thanks Tom.
However how do you send:-
int wiringPiSPIDataRW (int channel, unsigned char *data, int len)
especially the pointer *data in Python?
Googling around I came across this solution but it did not work.

Code: Select all

myData = str(70)+'\n'
wiringpi2.wiringPiSPIDataRW(1,myData)
print myData
by Grumpy Mike
Thu Sep 22, 2016 7:22 pm
Forum: Python
Topic: Reading two MCP3008 A/Ds
Replies: 7
Views: 1343

Reading two MCP3008 A/Ds

I can read the MCP3008 with the PiZero libiary or the wiringPi2 library. Each libiary allows you to choose what SPI channel the MCP3008 is on. This is determined by the GPIO pin used for the chip select pin on the MCP3008. However, I am at a loss to find out how to read two MCP3008s, one on each SPI...
by Grumpy Mike
Wed Jun 01, 2016 3:28 pm
Forum: Python
Topic: Posting a mouse event from Python
Replies: 10
Views: 1987

Re: Posting a mouse event from Python

Since I had this problem I contacted the writers of the Sky Writer Hat and they realised their mistake. They were not letting their driver sleep so it was hogging all the CPU time it could. They then changed the libiary, so it might be worth looking for the latest version is yours is an old one. Che...
by Grumpy Mike
Thu May 19, 2016 7:18 am
Forum: General programming discussion
Topic: Processing
Replies: 21
Views: 3242

Re: Processing

Why can't they just call a spade a spade? Because it is not a spade. It is a mark 3, manually operated, soil and small objects redistribution system. Or as stated at http://py.processing.org/reference/ Processing is not a single programming language, but an arts-centric system for learning, teachin...
by Grumpy Mike
Mon Mar 21, 2016 9:08 am
Forum: Python
Topic: Accessing Excel sheet using python in Raspbian
Replies: 6
Views: 4086

Re: Accessing Excel sheet using python in Raspbian

Well for a start a .csv file is not an Excel spread sheet file. It is, as the name implies, as "comma separated value" file. Print it out and you will see that there are values with commas between them. At the end of a row of values there is a CR character denoting the start of the next row. To move...
by Grumpy Mike
Thu Mar 10, 2016 5:36 pm
Forum: Python
Topic: Posting a mouse event from Python
Replies: 10
Views: 1987

Re: Posting a mouse event from Python

Can you post an example of the code you are running?
Thanks for the prompt. Always a good plan for finding stuff. While preparing a minimum version I found out that the removal of the Sky Writer Hat software made pyautogui work correctly, so I guess that it is screwing things up.
by Grumpy Mike
Thu Mar 10, 2016 4:58 pm
Forum: Python
Topic: Posting a mouse event from Python
Replies: 10
Views: 1987

Re: Posting a mouse event from Python

I have tried to use pyautogui and while the mouse clicks work fine the typewriter input does not. It is a glacially slow system and the output from the typewriter often has multiple characters but sometimes works fine. I find it works best when I set the interval = 0.0 and have tried all sorts of va...
by Grumpy Mike
Wed Mar 09, 2016 2:49 pm
Forum: Python
Topic: Posting a mouse event from Python
Replies: 10
Views: 1987

Re: Posting a mouse event from Python

Thanks, I will have a play with that and see where I get.
by Grumpy Mike
Wed Mar 09, 2016 2:41 pm
Forum: Python
Topic: Posting a mouse event from Python
Replies: 10
Views: 1987

Re: Posting a mouse event from Python

That's not what it does ! OK well it is close to what I said. I am not a Linux buff I just want to get a job done. What are you actually trying to do ? I am trying to control the Epiphany Browser from a Python script. I have got it to open the browser from Python with os.system("epiphany-browser ht...
by Grumpy Mike
Wed Mar 09, 2016 12:48 pm
Forum: Python
Topic: Posting a mouse event from Python
Replies: 10
Views: 1987

Posting a mouse event from Python

While you can use the os.system to insert a string into the keyboard buffer from Python, is there any similar way to insert a mouse event such as a click or mouse scroll?
by Grumpy Mike
Wed Feb 24, 2016 11:50 am
Forum: Python
Topic: WiringPi2 not working with OLED
Replies: 1
Views: 471

Re: WiringPi2 not working with OLED

[Solved] It looks like the the gaugette library defines the WiringPi module to work in the WPI_MODE_PINS mode where I was using the much more sensible real GPIO numbering mode. As the OLED module works in this mode I have had to change my code to work in it also, and then the "problem" goes away. Th...
by Grumpy Mike
Tue Feb 23, 2016 9:46 pm
Forum: Python
Topic: WiringPi2 not working with OLED
Replies: 1
Views: 471

WiringPi2 not working with OLED

I have an OLED display from Adafruit and I am using the gaugette library to drive it with the SPI. This works fine. However, it seems to stop the Pi from reading the other GPIO ports. I am not using any of the GPIO pins associated with the SPI. For example I set GPIO 26 as an input with the pull ups...
by Grumpy Mike
Tue Jan 12, 2016 9:43 pm
Forum: Raspbian
Topic: Wheezy runs on Pi Zero if firmware is updated -- is this OK?
Replies: 15
Views: 3613

Re: Wheezy runs on Pi Zero if firmware is updated -- is this

You know some idiot once said to me that the reason Linux was so great is that there were lots of updates. So many bug fixes. It seems that if the releases were properly tested then there would not be such a need for so many updates and bug fixes because the new releases would not introduce more bug...
by Grumpy Mike
Tue Jan 12, 2016 8:43 pm
Forum: Raspbian
Topic: Wheezy runs on Pi Zero if firmware is updated -- is this OK?
Replies: 15
Views: 3613

Re: Wheezy runs on Pi Zero if firmware is updated -- is this

Now after complete SD format and new install, it works and the zero also boots. Mind you it boots directly into the desktop which means that the screen goes blank seemingly half way through the boot before the desktop appears about 10 seconds later, not a good user experience. It seems that the old ...
by Grumpy Mike
Tue Jan 12, 2016 7:39 pm
Forum: Raspbian
Topic: Wheezy runs on Pi Zero if firmware is updated -- is this OK?
Replies: 15
Views: 3613

Re: Wheezy runs on Pi Zero if firmware is updated -- is this

Yes I backed up all the files on it but all the configuration and installed drivers are stuffed aren't they?
Many hours indeed days of fun putting them back.
by Grumpy Mike
Tue Jan 12, 2016 7:19 pm
Forum: Raspbian
Topic: Wheezy runs on Pi Zero if firmware is updated -- is this OK?
Replies: 15
Views: 3613

Re: Wheezy runs on Pi Zero if firmware is updated -- is this

Is your install noobs based? Yes it was. And after the instructions here didn't work I went over to that link and did what it said. Then nothing worked at all. It got part way through the boot ( this was on the original Pi not the zero ) and then froze saying there was no filing system for it to us...
by Grumpy Mike
Tue Jan 12, 2016 6:46 pm
Forum: Raspbian
Topic: Wheezy runs on Pi Zero if firmware is updated -- is this OK?
Replies: 15
Views: 3613

Re: Wheezy runs on Pi Zero if firmware is updated -- is this

I don't know. I am trying to boot my Pi Zero so I tried what you said and it all went fine. The kernel showed it was 4.1.15+ Tue Dec 15, it still worked on my original Pi, so, plugging it into the zero nothing kept on happening. No lights, no video. There is 5V and 3V3 on the appropriate GPIO pins. ...
by Grumpy Mike
Tue Jan 12, 2016 5:25 pm
Forum: Raspbian
Topic: Wheezy runs on Pi Zero if firmware is updated -- is this OK?
Replies: 15
Views: 3613

Re: Wheezy runs on Pi Zero if firmware is updated -- is this

This updated Wheezy will be OK for all models of RPi....
Except it isn't.
by Grumpy Mike
Tue Jun 16, 2015 3:03 pm
Forum: Graphics, sound and multimedia
Topic: Can't get GUCViewer working
Replies: 8
Views: 1750

Re: Can't get GUCViewer working

Uhm... the last info you can give us, it's is if you can reset the hue value by unplugging the camera... I know it's uncomfortable, it's just to test. Yes unplugging the camera does reset the Hue to zero and allow a one time change in guvcview. It is a real change by the way you can totally screw u...
by Grumpy Mike
Tue Jun 16, 2015 2:05 pm
Forum: Graphics, sound and multimedia
Topic: Can't get GUCViewer working
Replies: 8
Views: 1750

Re: Can't get GUCViewer working

You'll see all capabilities of your webcam. Then try to reset HUE value manually: Yes I was trying this yesterday. I can not set the Hue with say the v4l2-ctl --set-ctrl hue=9. If this does not work, instead of rebooting try to remove driver: sudo modprobe -r uvcvideo sudo modprobe uvcvideo Nothing...
by Grumpy Mike
Tue Jun 16, 2015 12:50 pm
Forum: Graphics, sound and multimedia
Topic: Can't get GUCViewer working
Replies: 8
Views: 1750

Re: Can't get GUCViewer working

guvcview -r 2 Thanks that indeed did run it. :) Not sure how I missed that in the searching I did yesterday, sorry. However, the first time you drag the Hue slider and set a new value of Hue then that is it. Nothing else seems to be able to reset it other than a reboot. So:- install new guvcview ve...
by Grumpy Mike
Tue Jun 16, 2015 9:59 am
Forum: Graphics, sound and multimedia
Topic: Can't get GUCViewer working
Replies: 8
Views: 1750

Can't get GUCViewer working

I have a Pi 2 and have downloaded and installed guvcview 1.5.3. It all seems to work except no video or still image is shown. This is from two cameras ( separately ) that work under openCV. I have set the permissions using:- sudo apt-get install guvcview sudo usermod -a -G video pi sudo modprobe uvc...
by Grumpy Mike
Wed Jun 10, 2015 9:14 am
Forum: Python
Topic: openCV closing a window with a mouse click
Replies: 5
Views: 1932

Re: openCV closing a window with a mouse click

Thanks again, but I have tried that as well, printing out all the events that get posted. There is nothing that is reported for a window bar click or a window closure. What happens is that when the cross is clicked the window shuts down but then pops up in a random place the next time the image show...
by Grumpy Mike
Tue Jun 09, 2015 10:12 pm
Forum: Python
Topic: google cardboard python VR
Replies: 3
Views: 2758

Re: google cardboard python VR

All that's needed then is a rotating disk that occludes each eye for half the time and rotates at the same speed as the FPS. Can't see any issues with this (apart from problems of synchronisation, epilepsy, gyroscopic forces, motors fixed to ones nose, disks spinning near to face...) I built one in...

Go to advanced search