Go to advanced search

by ferg
Sat Jul 30, 2016 1:10 am
Forum: Python
Topic: Can SCLK be used to check state of MISO?
Replies: 3
Views: 851

Re: Can SCLK be used to check state of MISO?

Hi Joan, in essence, yes that's what I'd like to do.
by ferg
Wed Jul 27, 2016 11:48 am
Forum: Python
Topic: Can SCLK be used to check state of MISO?
Replies: 3
Views: 851

Can SCLK be used to check state of MISO?

Evening all, I have a stream of binary data that I want to receive on a GPIO and manipulate later on. The data is not encoded (manchester etc) and was originally turned into a stream by another RPi SCLK and SPI. The data will be preceded and concluded with syncwords to identify the start and stop of...
by ferg
Mon Jul 11, 2016 9:46 am
Forum: Python
Topic: spi communication
Replies: 7
Views: 1973

Re: spi communication

Found a little info around the traps, but nothing concrete. This website https://xdevs.com/article/rpi_spi/ says the output of the simple program is 0,0,0,0,..... is this right??
Image
by ferg
Sun Jul 10, 2016 7:13 am
Forum: Python
Topic: spi communication
Replies: 7
Views: 1973

Re: spi communication

I'm getting nil o/p values like this as well. I've used http://tightdev.net/SpiDev_Doc.pdf to at least confirm my previous install, but it doesn't change anything. I did have other scripts (using SPI) working, but the basic test code (below) is not producing the expected o/p. I just get a column of ...
by ferg
Sun Jul 10, 2016 1:39 am
Forum: Python
Topic: Using SPI to light LED in 'bit check' loop?
Replies: 0
Views: 463

Using SPI to light LED in 'bit check' loop?

Hi all, After a little help to get SPI working to send LED command bits depending on a binary series. The SPI code works separately and the bit extract and file rebuild also works separately. I'm having trouble with the integration. The file is broken down to bits, the bits are sent to an if-else lo...
by ferg
Sat Jul 02, 2016 4:13 am
Forum: Beginners
Topic: Dotstar coding for RPi 2B?
Replies: 5
Views: 1819

Re: Dotstar coding for RPi 2B?

Hi James, I did get it working and can transmit square waves (ON/OFF) between two RPi's using Dotstar's. I will say that it is not the most economical way to send signals as each bit requires a 32 bit signal to go to the Dotstar's to turn them on. Anyway, I used the strandtest.py code on the Adafrui...
by ferg
Thu Jun 30, 2016 11:56 am
Forum: Python
Topic: How to read (rb) a *.txt file and o/p depend on 1 or 0?
Replies: 14
Views: 2800

Re: How to read (rb) a *.txt file and o/p depend on 1 or 0?

@Scotty, I'm using addressable LED's and they use 32 bit signals. So I need my code to take each file bit and o/p those 32 bits to GPIO (MOSI) for the LED's. It's not an elegant set-up, but something I hope to build on later. Ok, building on Dasmanul's example, my next step is to reverse the process...
by ferg
Thu Jun 30, 2016 10:48 am
Forum: Python
Topic: How to read (rb) a *.txt file and o/p depend on 1 or 0?
Replies: 14
Views: 2800

Re: How to read (rb) a *.txt file and o/p depend on 1 or 0?

Thanks @Dasmanul, I'll try that code to see if it runs better. @Ghans, At this point in time I'm just trying to get the 'file' into bits and ready to apply to a loop condition. After I've done that I want to reverse the file-to-bits code and make sure the bits-to-file process works too. This is the ...
by ferg
Wed Jun 29, 2016 11:34 am
Forum: Python
Topic: How to read (rb) a *.txt file and o/p depend on 1 or 0?
Replies: 14
Views: 2800

Re: How to read (rb) a *.txt file and o/p depend on 1 or 0?

Hi, I read more about text files and images (regarding bit level), found advice that jpg's are simpler to convert, so I thought I'd begin there instead. I'll move to text files next once I've got this working. I want to break down the image to bit level, send those bits to a GPIO as serial data, tra...
by ferg
Wed Jun 29, 2016 10:58 am
Forum: Python
Topic: How to read (rb) a *.txt file and o/p depend on 1 or 0?
Replies: 14
Views: 2800

Re: How to read (rb) a *.txt file and o/p depend on 1 or 0?

a little epiphany (discovery) since posting; with open("logo.jpg", "rb") as f: for line in f: for byte in line: i = ord(byte) bin = "{:08b}".format(i) print(bin) This gives me a list of bytes that I can convert to bits. My next question is; would it be better to convert the list into a long string a...
by ferg
Wed Jun 29, 2016 10:12 am
Forum: Python
Topic: How to read (rb) a *.txt file and o/p depend on 1 or 0?
Replies: 14
Views: 2800

Re: How to read (rb) a *.txt file and o/p depend on 1 or 0?

I've got some basic code happening but I believe that I still have another conversion of the data to go before I can use it. I can get it to pump out a screen of crazy symbols and also a column of byte values (ie 0-255) depending on coding approach, but not binary values. #open/read the image with o...
by ferg
Wed Jun 29, 2016 10:04 am
Forum: Advanced users
Topic: Is the Pi right for my needs?
Replies: 8
Views: 1582

Re: Is the Pi right for my needs?

https://learn.adafruit.com/adafruit-dot ... s/overview

there's heaps of info out there. You should also check out the NeoPixel Uberguide. It's on the same website. The NeoPixels and Dotstars are very similar, but I chose Dotstar because of the timing aspect.

F
by ferg
Thu Jun 23, 2016 11:00 am
Forum: Advanced users
Topic: Is the Pi right for my needs?
Replies: 8
Views: 1582

Re: Is the Pi right for my needs?

Get a separate power source with enough current to drive the length of LED strips you want to power. As above post, the RPi can control the LED's and I am currently using addressable LED's such as AdaFruit's Dotstars or Neopixels. You just need to install a couple of libraries, have something to run...
by ferg
Wed Jun 22, 2016 10:02 am
Forum: Python
Topic: How to read (rb) a *.txt file and o/p depend on 1 or 0?
Replies: 14
Views: 2800

Re: How to read (rb) a *.txt file and o/p depend on 1 or 0?

Thanks for your response!! I was hoping that if I were to open a text or word file with the read binary (rb) access mode, then it would read the file and store it in a temporary memory location as a whole lot of bits. These bits could then be passed through the loop to create the next action dependi...
by ferg
Sun Jun 19, 2016 6:14 am
Forum: Python
Topic: How to read (rb) a *.txt file and o/p depend on 1 or 0?
Replies: 14
Views: 2800

How to read (rb) a *.txt file and o/p depend on 1 or 0?

Hello, Can I read an arbitrary text file using the read (rb) command and get the same code to send a different 32 bit output depending on whether it is a 1 or 0? I imagine the front end will be opening and reading the file, then sending the bit string to a decision loop whereby it is checked for a 1...
by ferg
Mon May 30, 2016 12:31 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Does anyone know how to change CDIV value for SPI??
Replies: 1
Views: 410

Does anyone know how to change CDIV value for SPI??

Hi all, My RPi 2B has SPI enabled and SCLK is at 8MHz. I'd really like to increase that to 31.25MHz by entering 8 as the value for CDIV (250MHz/8). Does anyone know how to do this in python? The closest I can find is Pi-Plates using C for a DAQ problem, but I just want to set it to that specific val...
by ferg
Mon May 16, 2016 12:03 pm
Forum: OpenMAX
Topic: Can OpenMax play and convert h.264 to a bitstream?
Replies: 3
Views: 2499

Re: Can OpenMax play and convert h.264 to a bitstream?

Thanks for your response. I still have quite a bit of research to cover! At the moment, I'm looking for the simplest option and was thinking mkv as the container. So full audio and video at this stage and not an elementary stream. The video file needs to be broken down to bits and passed to a GPIO (...
by ferg
Mon May 16, 2016 9:26 am
Forum: OpenMAX
Topic: Can OpenMax play and convert h.264 to a bitstream?
Replies: 3
Views: 2499

Re: Can OpenMax play and convert h.264 to a bitstream?

Would FFMPEG be better suited for this??

I'm not asking anyone to do my homework, just to get some fast-track advice so I can do deeper research on something successful.
by ferg
Sun May 15, 2016 5:23 am
Forum: OpenMAX
Topic: Can OpenMax play and convert h.264 to a bitstream?
Replies: 3
Views: 2499

Can OpenMax play and convert h.264 to a bitstream?

Good afternoon, I'm trying to find a general direction/solution to a small project I'm working on with my RPi 2B. I want to open an h.264 video file and at the same time as playing the video, convert it into a real-time stream of bits/bytes. This seems like a challenge I know, but I'm hoping that it...
by ferg
Wed May 04, 2016 10:23 am
Forum: General programming discussion
Topic: Code output based on GPIO/Process Condition
Replies: 2
Views: 479

Re: Code output based on GPIO/Process Condition

I tend to over-verbalise things!!

I haven't put a thought to data clocking yet. I'll probably use SCLK for the output (of the 32 bits) and look to get up to a pretty fast rate.
by ferg
Tue May 03, 2016 12:15 pm
Forum: General programming discussion
Topic: Code output based on GPIO/Process Condition
Replies: 2
Views: 479

Code output based on GPIO/Process Condition

Hi all, I am after some advice on the best approach to implement a very rough concept I want to try. Let's say I have a digital signal on one of the GPIO's and I want to have some code that will output a 32 bit instruction (0xFFFFFF) to another GPIO when it sees a logic high on that GPIO. A logic lo...
by ferg
Mon Mar 28, 2016 12:30 am
Forum: Beginners
Topic: Dotstar coding for RPi 2B?
Replies: 5
Views: 1819

Re: Dotstar coding for RPi 2B?

hi all, copied a few examples of code from various sources but still can't get the LED to light. The code I'm using is Adafruit's Dotstar 'strandtest' example, but cut down for a single LED. Current code is attached. I have a level shifter set up per the pic below and it seems to be wired correctly....
by ferg
Wed Mar 23, 2016 10:43 am
Forum: Beginners
Topic: Dotstar coding for RPi 2B?
Replies: 5
Views: 1819

Re: Dotstar coding for RPi 2B?

thanks, I've seen this page, but I haven't been able to get it to run. It jumps from downloading to 'whats next'... My coding is almost non-existent and I am new to RPi.
by ferg
Wed Mar 23, 2016 9:54 am
Forum: Beginners
Topic: Dotstar coding for RPi 2B?
Replies: 5
Views: 1819

Dotstar coding for RPi 2B?

Evening, I have connected my RPi 2B up to a single Dotstar with a 74AHCT125 complete with inline GPIO resistors etc. I have all the hardware present and correctly connected. Now, I am trying to find (step by step) code to run on the RPi to light up the Dotstar. Firstly just to light it up and second...
by ferg
Tue Mar 22, 2016 9:41 pm
Forum: Beginners
Topic: [Solved] Keyboard and mouse not working
Replies: 31
Views: 18461

Re: Keyboard and mouse not working

Search for devices connected to your router (google the ip for model router). Mine is listed under "raspberrypi" and is something like 192.168.1.xx Look for MobaXTerm. This is freeware that will let you access your RPi from your normal PC via SSH. No need for individual keyboard, mouse or monitor. Y...

Go to advanced search