- 15,400
- TRAPPIST-1g
- ProjectWHaT
I sent my dead motherboard in for warranty last week and got a replacement! I'm back on my gaming PC finally!
I wonder if there's a cross-compiler for the BCM2835 (or pedantically the ARM1176 CPU) so you could compile it or other large projects on a desktop/laptop then just copy the compiled binary over to the Pi. Actually I'm sure there is; just a question of finding it. I was amazed to find that GCC is installed by default on the Pi; figured I'd have to install it myself if I wanted to do anything in C.Yeah, I've heard it can take up to an hour to compile the code for the Descent source port, seeing as it'd take me about a quarter of that time to download it on my PC I don't think I'll bother...
As for heatsinks, they're typically just tiny self-adhesive things, not much more to say about them; I bought mine from here but I've seen a few places selling more or less the same thing. I've got a model B Rev.2 (with the P5 and 6 headers and GPIO 27 instead of 21, for whatever reason), and it hit 48C today doing absolutely nothing at all. In the shade, too, though it has been kind of warm today. That is if you're out of the wind and rain, anyway.
What are you using for a temperature sensor? Sounds like it could be a nifty thing to have.
Ah, cool! I didn't know about those; figured I'd have to pick up some sort of thermal sensing device, etc, etc. That makes it too easy!You have two choices:
/opt/vc/bin/vcgencmd measure_temp
Or:
/sys/class/thermal/thermal_zone0/temp
The latter gives you the measurement in millicelcius, and that's how I'm getting my data (since I know how to read files with Python but not how to get the results of a command into Python). If I had my Pi plugged in I'd post the code for the small program that reads the file, converts the string to an int then 'breaks out' each digit into individual array cells, but a) I don't have it plugged in and b) it's really, really simple anyway, like ten lines or something.
$ cat /sys/class/thermal/thermal_zone0/temp
Not sure why you'd want to read a string into an int then extract each digit into an array element especially since strings are, at heart, arrays of chars or at least easily converted into such.
digit = int('41160')
thousands = digit / 10000
array[0] = thousands
hundreds = (digit % 10000) / 1000
array[1] = hundreds
tens = (digit % 1000) / 100
array[2] = tens
ones = (digit % 100) / 10
array[3] = ones
I have no idea where it came from but my work computer magically had Conduit on it this morning when I got in.
It has now been remedied.
I've removed it from plenty of other people's machines but I've never had any viruses on my own before.I have seen that on so many customer PCs.
I downloaded some software for construction cameras but that was from the camera manufacturer's site (axis.com) so I didn't, and still wouldn't, think twice about it. Besides that, nothing of note.What have you installed recently?
Ah, okay, makes sense now; I've worked with multiplexing seven-segment displays before.Very long story short, because I have to multiplex the display (it's a DIP-12 4-digit display IC, 8 pins are bussed amongst the four digits' segment anodes, the other four are the digits' discrete cathodes) I have to synchronise what the two 595s are doing and to do that I need to be able to basically tell it that 'when 595A is grounding the leftmost display's cathode, 595B should push the leftmost digit to the anodes' and so on so that the correct digit shows the correct place value. In addition to that, I have to use the integers as array pointers (not sure if that's the right word) to basically map the values to the correct 7-seg hex, since obviously if I tell a 595 to just output '4' it'll give me 0000 0100 when I need 0110 0110 (0x66 or whatever the sum of 64, 32, 4 and 2 is).
So, if there is a shorter way of converting (for example) the string '41160' into array = [4, 1, 1, 6] than:
Code:digit = int('41160') thousands = digit / 10000 array[0] = thousands hundreds = (digit % 10000) / 1000 array[1] = hundreds tens = (digit % 1000) / 100 array[2] = tens ones = (digit % 100) / 10 array[3] = ones
I'd love to know what it is! I'm just reusing old code that has worked for me before.
Edit: I did actually find a better way of writing this, and I think I've just worked out a better way while typing this sentence, I guess you can probably do int(array[number]) so even if the array was full of chars it wouldn't really matter. I can't be bothered to test this right now, though.
strcpy( input, "41160" );
for ( i = strlen( input ); i; ; )
{
i--;
digits[i] = input[i] - 0x30;
}
digits[i] = substr( input, i, 1 );
digits[i] = input % 10;
input /= 10;
Very cool! (no pun intended).- I can't start and stop it at will,
- I had to make a separate program to control the 'polling' rate because I just wanted it to work soon rather than work properly so I skipped the interrupt service routine it'll eventually need,
- If I try to run it in the background, when I kill it I'm (predictably) left with stuff displayed and the GPIOs stay reserved because the cleanup functions aren't allowed to run.
(no pun intended)
file = open('/home/pi/scripts/temperature','r')
digits = list(file.read())
file.close()
del digits[3:]
if digits != []:
digits.append(10)
for x in range(0,4):
writenumber(displaycathode[x])
if digits != []:
if x == 1:
writenumber(letterrange[int(digits[x])]+1)
else:
writenumber(letterrange[int(digits[x])])
writeout()
I can only answer this question with an "I don't know" but I would like to make a comment here: If you make a bitwise copy of the SSD onto another medium it should work, and should show up as a 128GB drive which will have to have the partition size(s) adjusted. I have no idea if your OSX utility can do it, but the standard unix "dd" command can clone drives this way; Incidentally your Raspberry Pi implements the "dd" command.The questions:
- If I clone my current SSD with OS X's Disk Utility, would I be able to restore a formatted hard drive with that image so that it's an exact copy of the SSD? I realise the best answer to this is probably for me to just try it but it'll take some time to even find a spare hard drive, so I just wonder if anyone has done this before and can give me a 'yes' or 'no'.
Alternatively, burn the .iso onto a USB flash drive, SD card, or some such.- If I want to start fresh (which I actually really do) and decided to give Windows 8.1 a trial run, instead of burning the .iso onto a DVD (I don't own a DVD burner because I'm not a dinosaur), could I clone it onto a spare hard drive (again with OS X's Disk Utility) and boot from that to install it onto the new SSD?
I can only answer this question with an "I don't know" but I would like to make a comment here: If you make a bitwise copy of the SSD onto another medium it should work, and should show up as a 128GB drive which will have to have the partition size(s) adjusted. I have no idea if your OSX utility can do it, but the standard unix "dd" command can clone drives this way; Incidentally your Raspberry Pi implements the "dd" command.
Alternatively, burn the .iso onto a USB flash drive, SD card, or some such.
I'd certainly think so. Incidentally Win32 Disk Imager is a very good utility for burning .iso images onto flash media. It would also be a good idea to format the flash drive/card with SD Formatter beforehand as well. Don't use the native Windows formatting tools on flash media. I use both of those tools a lot. Note that in spite of the name, SD Formatter works with USB flash drives too.As for burning the .iso to a USB flash drive, I wasn't sure if I could boot from a USB device but now that I think about it, surely a PC built in 2011 - one with UEFI, which seems to be a good thing? - would have that functionality.
import uinput
device = uinput.Device ([
uinput.KEY_A
])
device.emit_click(uinput.KEY_A)
...while the B+ will end up in a sort-of laptop thing I'm sort-of making very, very slowly.
.
Have you made any progress with it since you last updated the thread for it? I'm very interested to see how it turns out. 👍