Go to advanced search

by mirojr
Mon May 05, 2014 3:13 pm
Forum: Bare metal, Assembly language
Topic: gpio led sudo segmentation fault
Replies: 9
Views: 4354

Re: gpio led sudo segmentation fault

Yes thanks. I have been totally side tracked trying to hook up this scratch python thing. So I haven't got round to it yet.
Cheers
by mirojr
Mon May 05, 2014 10:31 am
Forum: Bare metal, Assembly language
Topic: gpio led sudo segmentation fault
Replies: 9
Views: 4354

Re: gpio led sudo segmentation fault

Thanks

I will try this.
by mirojr
Fri May 02, 2014 10:00 am
Forum: Scratch
Topic: cant find python mesh scratch simple examples
Replies: 15
Views: 5679

Re: cant find python mesh scratch simple examples

Finally got the thing to work in its absolute basic form. Its a Kernighan type HelloWorld GPIO at best. I might post it with the scratch interface showing as well, because for novice like myself was a bit tricky finding out how to do very basic broadcast. Thanks Gerhard and Thomas Preston https://gi...
by mirojr
Thu May 01, 2014 5:07 pm
Forum: Scratch
Topic: cant find python mesh scratch simple examples
Replies: 15
Views: 5679

Re: cant find python mesh scratch simple examples

Great that Gerhard

Many thanks for your help
by mirojr
Thu May 01, 2014 3:51 pm
Forum: Scratch
Topic: cant find python mesh scratch simple examples
Replies: 15
Views: 5679

Re: cant find python mesh scratch simple examples

Hello, tried some things in python3, and think that something like the following snippet will solve the problem: cmd = 'broadcast hello' # # the length is the number of bytes in the message, not the number of characters. # n = len(bytes( cmd, 'UTF-8')) a = array('b') # convert len to the first four...
by mirojr
Thu May 01, 2014 3:43 pm
Forum: Scratch
Topic: cant find python mesh scratch simple examples
Replies: 15
Views: 5679

Re: cant find python mesh scratch simple examples

Well signed char should I say, for b
by mirojr
Thu May 01, 2014 3:42 pm
Forum: Scratch
Topic: cant find python mesh scratch simple examples
Replies: 15
Views: 5679

Re: cant find python mesh scratch simple examples

Ok got it.

Typecode.

Char
by mirojr
Thu May 01, 2014 3:38 pm
Forum: Scratch
Topic: cant find python mesh scratch simple examples
Replies: 15
Views: 5679

Re: cant find python mesh scratch simple examples

Ok thanks Closest I got for my output was: b'\x00\x00\x00\x10'broadcast"hello" from using def sendCMD(cmd): n = len(cmd) a = [] a.append((n >> 24) & 0xFF) a.append((n >> 16) & 0xFF) a.append((n >> 8) & 0xFF) a.append(n & 0xFF) b = '' for i in list(range(len(a))): b += str(a...
by mirojr
Thu May 01, 2014 2:24 pm
Forum: Scratch
Topic: cant find python mesh scratch simple examples
Replies: 15
Views: 5679

Re: cant find python mesh scratch simple examples

Thanks

I will look at this code.

will look how python 3 is handles its 4 byte buffer. It seems that the encoding on 2.7 is much more straight forward. Especially how it concatenates it all.
by mirojr
Thu May 01, 2014 12:53 pm
Forum: Scratch
Topic: cant find python mesh scratch simple examples
Replies: 15
Views: 5679

Re: cant find python mesh scratch simple examples

Ok the 4 bytes I get now.

I appends this to the beginning of the string, they are hex values of bytes when displayed, but cast to strings I think

the version in python 3 doesn't perform this well.

Anyway I will keep looking
by mirojr
Thu May 01, 2014 12:38 pm
Forum: Scratch
Topic: cant find python mesh scratch simple examples
Replies: 15
Views: 5679

Re: cant find python mesh scratch simple examples

Thanks

It looks like your code is for use with python 2.7

I am still wondering why the version 3 code doesn't actually work.

I am going to keep looking.

Just trying to understand this 4 byte section yet!
by mirojr
Thu May 01, 2014 6:40 am
Forum: Beginners
Topic: gpio 17,20,25 used for ground
Replies: 6
Views: 1068

Re: gpio 17,20,25 used for ground

:D agreed! exactly what I felt when reading it.
by mirojr
Wed Apr 30, 2014 1:52 pm
Forum: Scratch
Topic: cant find python mesh scratch simple examples
Replies: 15
Views: 5679

Re: cant find python mesh scratch simple examples

Thanks I am actually after getting an understanding of the mesh python handling. Not many tutorials. Am having to root through code and try and figure it out. But I suppose that's the best way to learn. Its mainly the scratch side that's seems harder. The passing of the strings etc. I am trying to g...
by mirojr
Wed Apr 30, 2014 12:51 pm
Forum: Beginners
Topic: gpio 17,20,25 used for ground
Replies: 6
Views: 1068

Re: gpio 17,20,25 used for ground

Ok cheers

The ocr pdf
http://www.ocr.org.uk/Images/129940-rec ... lights.pdf

states pin 17 as ground
by mirojr
Wed Apr 30, 2014 12:31 pm
Forum: Beginners
Topic: gpio 17,20,25 used for ground
Replies: 6
Views: 1068

gpio 17,20,25 used for ground

Hi Just trying to find out why the GPIO pins 17,20,25 are ground connections in this circuit http://www.ocr.org.uk/Images/129940-recipe-card-traffic-lights.pdf They are labelled as DNC on this pinout diagram do not connect http://www.hobbytronics.co.uk/image/data/tutorial/raspberry-pi/gpio-pinout.jp...
by mirojr
Wed Apr 30, 2014 7:43 am
Forum: Scratch
Topic: cant find python mesh scratch simple examples
Replies: 15
Views: 5679

cant find python mesh scratch simple examples

hi I am looking for a simple example to get me started connecting python to scratch using mesh. I used the examples from http://wiki.scratch.mit.edu/wiki/Communicating_to_Scratch_via_Python_3.x I have python 2.7 and 3.3 The example initially didn't work due to b += a[i] TypeError: Can't convert 'int...
by mirojr
Tue Apr 29, 2014 4:00 pm
Forum: Bare metal, Assembly language
Topic: bootcode.bin start.elf
Replies: 1
Views: 1784

bootcode.bin start.elf

Is there anyone who could outline the bootcode.bin start.elf and kernel.img but in the context of older 8 bit systems?

Things were complicated with 8 bit systems, but now its very complicated.

Does the bootcode.bin act as a bios with an instruction set similar to ARM?

Thanks
by mirojr
Tue Apr 29, 2014 3:35 pm
Forum: Bare metal, Assembly language
Topic: baking pi usb or sd
Replies: 6
Views: 2330

Re: baking pi usb or sd

I booted into rasbian copied my bootcode.bin and start.elf onto the SD card along with my kernel.img and it all worked.
So thanks for that.
by mirojr
Tue Apr 29, 2014 3:15 pm
Forum: Bare metal, Assembly language
Topic: baking pi usb or sd
Replies: 6
Views: 2330

Re: baking pi usb or sd

Seems the Baking Pi tutorial doesn't really mention the files I need :(

Bit of a non-starter for me that
by mirojr
Tue Apr 29, 2014 3:03 pm
Forum: Bare metal, Assembly language
Topic: baking pi usb or sd
Replies: 6
Views: 2330

Re: baking pi usb or sd

Thanks David The noobs card didn't have a kernel.img image, just some recovery images. It was as if it had not uncompressed into the selected OS or something. If I look at /boot whilst in raspbian I can see the files as expected, but not while the card is in my laptop. Anyway I will try another SD c...
by mirojr
Tue Apr 29, 2014 9:55 am
Forum: Bare metal, Assembly language
Topic: baking pi usb or sd
Replies: 6
Views: 2330

baking pi usb or sd

Hi My first question is do I need to format my SD card before adding the kernel.img? Or can I add the kernel.img file to any sd card and boot from that? My current SD card has noobs and that has no kernel.img to rename. I tried just adding the kernel.img but I think it boots slightly differently tha...
by mirojr
Tue Apr 29, 2014 9:05 am
Forum: Beginners
Topic: gpio output
Replies: 15
Views: 2005

Re: gpio output

So I can exclude the optocoupler or is this better to have Genuine question, I don't know, but aren't they used because 1) you want no electrical connections between two systems, or 2) you want to prevent the possibility of dangerous voltages entering a system I don't think either applies in your c...
by mirojr
Tue Apr 29, 2014 8:48 am
Forum: Beginners
Topic: gpio output
Replies: 15
Views: 2005

Re: gpio output

So I can exclude the optocoupler or is this better to have
by mirojr
Tue Apr 29, 2014 8:21 am
Forum: Beginners
Topic: gpio output
Replies: 15
Views: 2005

Re: gpio output

Thanks. That's good. (and I think I bought a Darlington array a few days ago)

That aside if I needed the relay circuit is there a minimum circuit for the gpio on the pi?
by mirojr
Tue Apr 29, 2014 7:54 am
Forum: Beginners
Topic: gpio output
Replies: 15
Views: 2005

Re: gpio output

Thanks for the input. It looks like I will need a relay as the transistor as an amplifier doesn't look like it will cut it, although I do not have the spec for the bulb to be sure, but I know a little battery power would definitely work. Rather than use my piface with its relays I am going to create...

Go to advanced search