Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - techb

Pages: 1 [2] 3 4 ... 119
Feedback / modify therad
« on: April 03, 2014, 12:25:16 pm »
When I go to modify a post, it acts like it will work, but after I hit save, I am redirected back to a blank modify page.

It doesn't change, and will continue to loop back to the same page with no changes. I have tried mobile and diff desktop browsers, they all do the same. Just letting you know. Idk if it's just me and on my end.

General discussion / Troll Day
« on: April 01, 2014, 03:46:14 pm »
April first is kinda the troll day, so post the good trolls you find.

HackaDay, lol quad copters with CPU fans, only if I could get dat lucky.

Despite my wifes birthday being today, thanks Google for le reminder. But really Fables birthday is today. She also hates April fools, so troll where you can, she never checks EZ. Lulz.

This thread doe, post clever trolls and dahhh such. 123 go, op is fag.

Members introduction / Re: P01s0n arrival!!!
« on: March 31, 2014, 05:30:29 pm »

I don't knw y i try... :(
well atleast its the only place i can't get banned!!!! -5 cookies in 3 days 3 bans in 24hrs I miss hack forums...I guess i will go back to the elite!

If you want a ban it can happen. Just fuck up or say the words fag. Trollling is best served with a 7 day ip ban and with a side of go fuck yourself. Bro, do you even forum? FAG.

Members introduction / Re: P01s0n arrival!!!
« on: March 31, 2014, 03:39:10 pm »
Da fuq are you? Da fuq is that thing? Da fuq u say? We're going to ride what? Da fuq is she? I don't know what's going on anymore [epicoutmusic.mp3]

Welcome fag.

Feedback / Re: Alpha Site
« on: March 28, 2014, 03:07:44 am »
That isn't leet speak. That's pretty much just what ASCII looks like in a terminal.

In binary or something in a bin format like executables.

In binary or something in a bin format like executables.

It's okay though OP, we never expected simple minds to understand.

Staff note: y u double post?

Projects and Discussion / Re: Download a file via bittorrent in python
« on: March 24, 2014, 11:18:19 pm »
Yea I've seen Deluge it wasn't reeeeeeaaaally what I was wanting  :P
Specifically the python wrapper they use for libtorrent

It has source code you can look at to figure out how it works, and also is able to support plug-ins, so it is/could be a starting point to doing it yourself. Figure out how they do it and make it into something of your own. No better resource than an already open platform for you to learn from.

You will learn more from our EBook section than anything other places have to offer [tutorial wise anyway]. Yeah, we don't have videos, but youtube is full of great vids. Look up some defcon talks and programming lectures from MIT and other opencourseware stuff.

Hardware / [Arduino] TFT LCD sensor data
« on: March 24, 2014, 09:58:57 pm »
At my local RadioShack they had some TFT LCD shields for sale, so I snagged one. They come from SeeedStudio I have version 1.0, NOT the one with the SD card slot:

I didn't really have an idea when I got it what I was going to use it for.  Maybe Game of Life, or a GUI for some robot I hadn't thought up yet, a panel for some kind of home automation, IRC pms or name mentions, etc... I decided on using it to display my laptops temp and some usage info.

Here is a picture of the final result. Sorry for potato quality and sizing:

Now for the part you want, le code. I used Python for the computer to send the data, this is on Arch Linux, but should work for all *nix distros. I didn't test it on Windows, so IDK if they python will work for you Windows folks. I know the Serial lib  wors on windows, but if the other libs don't, you might be able to find an alt.

I put the Python script in my autostart script so it runs at boot.

The code is heavy commented, so I wont explain how it works, the comments explain everything.

Code: C
  1. // Display sensor data on TFT display from SeeedStudio
  2. // Techb 3/20/14
  3. // Arduino Duemilanove ATmega328p
  4. //   should also work with any *Standard* Arduino
  5. //   that has shield compatibility. Else wiring it by
  6. //   hand would be required. See TFT docs for pinouts
  7. //   and more info.
  9. //used by SeeedStudio
  10. #include <Seeed_TFT.h>
  12. //Defines for the shield, comes directly from their TFT examples
  13. #ifdef SEEEDUINO
  14.   #define YP A2
  15.   #define XM A1
  16.   #define YM 14
  17.   #define XP 17
  18. #endif
  20. //I'm not using an ArduinoMEGA, so this really isn't needed
  21. //But keeping it for compatiablity
  22. #ifdef MEGA
  23.   #define YP A2
  24.   #define XM A1
  25.   #define YM 54
  26.   #define XP 57
  27. #endif
  29. //for the serial in buffer
  30. char serIn;
  31. String data;
  33. //for splitting into an array
  34. String dataArray[4];
  35. char dataBuff[50];
  36. int idx = 0;
  38. void setup()
  39. {
  40.   //do a .begin() to keep baud correct, else expect
  41.   //  random ascii and other crap
  42.   Serial.begin(9600);
  43.   //used by Seeeds' lib
  44.   Tft.init();
  45.   //set orintation, note (x,y) values are foobar
  46.   //  Seeeds' lib is kinda crap
  47.   Tft.setDisplayDirect(UP2DOWN);
  49.   //Serial.println("Init Done, starting...");
  50. }
  52. void loop()
  53. {
  54.   //clear the screen before updating the data
  55.   //  else the updataed values would overlap
  56.   Tft.paintScreenBlack();
  57.   //Tft.drawString(string, y, x, size, color)
  58.   //  decreasing y makes the text go down
  59.   //Normaly it would be drawString(string, x, y, size, color)
  60.   //  but as stated above, the lib kinda sucks and seems like
  61.   //  pixel coords aren't in concideration, so hard code the shit
  62.   Tft.drawString("TempF: ", 230, 0, 4, GREEN);
  63.   Tft.drawString("Core1: ", 190, 0, 4, GREEN);
  64.   Tft.drawString("Core2: ", 150, 0, 4, GREEN);
  65.   Tft.drawString("Mem %: ", 110, 0, 4, GREEN);
  67.   //check for data on serial
  68.   //  NOTE: doing *.available() > 0
  69.   //  will infinate loop
  70.   //The concat idea came from:
  71.   //
  72.   //Normaly/you could do it the C way and read it in byte by byte
  73.   //  to a char[]
  74.   //Add the data to an array as we get it, hence why I'm using
  75.   //  and ending delimiter
  76.   while (Serial.available()) {
  77.     serIn =;
  78.     //',' seporates; '!' notes end of data sent
  79.     if (serIn != ',' && serIn != '!') {
  80.       data.concat(serIn);
  81.     }
  82.     else {
  83.       dataArray[idx] = data;
  84.       idx++;
  85.       data = "";
  86.     }
  87.     delay(10); //delay cause sometimes it will do char by char
  88.                //  instead of the full string, results varried
  89.                //  without it.
  90.   }
  91.   idx = 0;
  93.   //for testing
  94.   //  replace this with writing to TFT
  95.   unsigned int loc = 230;
  96.   if (dataArray[0] != NULL) {
  97.     for (int i = 0; i < 4; i++) {
  98.       //Serial.println(dataArray[i]);
  99.       dataArray[i].toCharArray(dataBuff, 50);
  100.       Tft.drawString(dataBuff, loc, 190, 4, WHITE);
  101.       loc -= 40;
  102.     }
  103.   }
  104.   //Serial.println("*");
  105.   delay(5000);
  106. }

Python 2.7.x
Code: Python
  1. #Requires:
  2. #  *PySerial
  3. #
  4. #  *PSUtil
  5. #
  7. import serial, os, psutil, time, sys
  9. def getSensorData():
  10.     #grep magic to get temp
  11.     temp = os.popen("sensors | grep temp1 | grep -o '+[0-9]'*").read()
  12.     temp = temp.strip()[1:]
  13.     #convert to ferenheit, round to nearest whole number
  14.     temp = int(round((int(temp)*1.8)+32))
  16.     #per core, loop it nigger
  17.     cores = psutil.cpu_percent(percpu=True)
  19.     #RAM in %, use it nigger...
  20.     mem = psutil.virtual_memory().percent
  21.     return (temp, cores[0], cores[1], mem)
  23. try:
  24.     #use with so in case of unexpected exit, handle is closed
  25.     with serial.Serial('/dev/ttyUSB0', 9600) as s:
  26.         while True:
  27.             data = getSensorData()
  28.             s.write("%d,%s,%s,%s!" % data)
  29.             print data
  30.             time.sleep(5)
  32. except IOError:
  33.     print "Failed to get handle, exiting"
  34.     sys.exit()

Projects and Discussion / Re: Download a file via bittorrent in python
« on: March 24, 2014, 09:06:17 pm »
I second Deluge, that's what I use.

Projects and Discussion / Re: Post Your Github
« on: March 21, 2014, 12:00:40 am »

Hardware / Re: Xbox One Mods
« on: March 18, 2014, 11:27:19 pm »
Here is a controller mod from Ben Heck (love this guy and his show). He also did a PS4 edition recently this past Sunday.

One Handed XBox One controller for the Handy Capped:

Kip Kay can go suck a dick.

eBooks / Re: [skidiot.h] CISSP All-In-One Exam Guide - Shon Harris
« on: March 05, 2014, 01:02:27 am »
This is 5th Version of AIO !

This thread is 2 years old, what else do you expect, leech.

eBooks / Format Converter
« on: March 04, 2014, 11:54:50 pm »
I'm looking for a good format converter for ebooks. Something that can convert pdf, epub, doc, docx, to something a kindle will see as a book like kf8 or azw(mobi).

I see a LOT of things from google, but as you all know this kinda thing can be riddled with crap. Just seeing if any of you have something that you use and know works well. Just want to get an opinion before dl all willy nilly.

I found that calibre can convert files, and will be using that. I thought it was just a library type thing. If you guys have any other suggestions that's cool, but I think I'll go with calibre for now.

Feedback / Re: Mark as read
« on: March 03, 2014, 05:51:14 pm »

You cant mark a category as read afaik but you can do boards. Top right button when you are inside said board.

I stand corrected. Thank you kitty.  :)

Hardware / Re: [Arduino] Bot move left, right functionality
« on: March 03, 2014, 05:34:55 pm »
yes :) many thanks techb. Now I only need to get one of these rotatory encoders. But it seems like those are exactly what I was looking for. I already know the page you posted. Its awesome :) I just started out with it so mine is pretty, pretty basic at the moment. Will post some pictures or maybe a video as soon as there is something to see.. lol.

Do what you need to. And you don't know how happy I am to see something like this here. We need more hardware stuff, and I even have a few tuts lined up If I would ever post them. Arduino is good for intro level stuff, but RBA needs the other. The other being embedded systems. 

Don't get wooed by Arduino, in the end it is just a boot loader, and making thing easy. Behind that "Arduino" is an Atmega 328 AVR waiting for you. Waiting for you to learn clock cycles, <- yes they are desperately important, code your own and learn why that crystal is there to support such things.

We/you are stepping into how and why a processor works, this simple 8bit core can "really" show you why a stack over flow is so important, or why we preach memory management [at least me]. I WANT you to learn the whys and hows it happens.

But I am doing exactly, what my wife hates me for though. Making her/you learn. What the diff here is, I have a feeling you want to know. You want to understand what happens in the digital world, cause that's the only world that you or I or anyone here can relate to.

I am not a psychologist, and even in this thread evaluating why I married her...

But you wanna know about embedded systems, there it is, Arduino is overrated, it "Arduino" is like python, treat it as a gateway if you really want to know things. It is easy, it is something noobs or such can get into. BUT, just like python, you need to know how it works, when and where to use it.

You can and will eventually know what I am talking about if you go down this road. Just ask PORTA and PORTB.

Arduino is easy, the question I ask (drunken or not), do you want to know? Easy or what it was supposed to be?

Again sorry for this, I am drunk and have seen things in this embedded world and am at a cross roads. I know and have done things the hard way, and have done things the easy. I will admit the easy has lead me into the hard and have been learning since. I....

Do the Arduino thing until you want to know and learn MORE, I am here to show and teach, not discriminate. Drunkin speeches or not, you are a friend RBA and I will try and guide. But when it comes to config a Cisco router or advice on network topology, I will be the dog begging  ::)

PM me or put it here, I will help in this embedded world you want to endure. Only the best for a friend.

Again, drunken posts are the best right?

Going back to the matter at hand {ahem}
You will need two encoders  one for each motor. A zero point turn radius is ideal for a two wheel bot. The Arduino you have should handle the bot okay. The next logical step in this project is PID. PID is usually reserved for line following things, but PID might be where you *could* go next with the code of things.

If hardware is more your style, then you could go with more of a B.E.A.M. approach and have feelers or antennas signaling the motors and such. But, thing are up to the person at hand. Just let me know where you wanna take it and I'll help.

Pages: 1 [2] 3 4 ... 119

Intern0t SoldierX SecurityOverride programisiai
Want to be here? Contact Ande, Bluechill or Kulverstukas on the forum or at IRC.