Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
what one??
atom
brackets
sublime text
i am l33t and use nano, op
other
View Results
 
  • Locked thread
Workaday Wizard
Oct 23, 2009

by Pragmatica

pram posted:

just learn vim you idiot

heres a vim command for u
:FU!

Adbot
ADBOT LOVES YOU

pram
Jun 10, 2001

Shinku ABOOKEN posted:

heres a vim command for u
:FU!

not a command

Captain Pike
Jul 29, 2003

You should all just read rotor's posts and do what he says.

echinopsis
Apr 13, 2004

by Fluffdaddy

PleasureKevin posted:

I thought you were a lazy pharmacist?? you program??


I used to like you. the I found out your avatar wasn't Ali g and you liked Microsoft things

ugh yes

code:
#include <Encoder.h>
#include <Adafruit_NeoPixel.h>


int strip_length = 8;
int strip_pin = 7;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(strip_length,strip_pin);

Encoder myEnc(3, 4); //setup encoder on those pins (only 1 is an interrupt for medium accuracy according to library)

int red1=0;
int green1=0;
int blue1=0;

int red2=0;
int green2=0;
int blue2=0;


uint32_t basecolour = strip.Color(red1,green1,blue1);
uint32_t changecolor = strip.Color(red2,green2,blue2); //0,200,255 is a nice blue

// lookup table that corrects for the non linear brightness of LEDs and PWMs
// sourced from internet, is based on a few things and is somewhat s shaped 
static const int values[256] = 
{
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
  0x02, 0x02, 0x03, 0x03, 0x03,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xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFC,
  0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD,
  0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFF, 0xFF
};

float colourdivisor; //initialisation

long t=0; //time counter
long buttonrate=400; //debonuncer for button

int colourindex=2;

long oldPosition  = -999;
long newPosition;
int newColour;

int increment=0;
int incrementamount=4;

int locus=-1;
bool blink_state=0;
long blink_timer;

void setup() 
{
  Serial.begin(9600);
  Serial.println("Basic Encoder Test:");

  strip.begin();
  stripgradient();
  strip.show();

  attachInterrupt(0, increment_locus, FALLING);
  t=millis();

  pinMode(2, INPUT);
  digitalWrite(2, HIGH);
}

void loop() 
{
  increment=0;
  stripgradient();
  if (blink_state==1)
  {
    blink();
  }
  Serial.println(digitalRead(2));
  strip.show();
  
  newPosition = myEnc.read();
  if (newPosition > oldPosition) 
  {
    oldPosition = newPosition;
    increment=incrementamount;
    modifycolour();
  }
  else if(newPosition < oldPosition)
  {
    oldPosition= newPosition;
    increment=-incrementamount;
    modifycolour();
  }
}

void blink()
{
  if (millis()>blink_timer+buttonrate && digitalRead(2)==HIGH)
  {
    blink_state=0;
    return;
    blink_timer=millis();
  }

  /*if (digitalRead(2)==LOW)
  {
   blink_state=0;
    return;
  
  }*/

   

  switch (locus)
  {
    case 0:
    strip.setPixelColor(strip_length-1, 255, 0, 0);
    break;
    case 1:
    strip.setPixelColor(strip_length-1, 0,255,0);
    break;
    case 2:
    strip.setPixelColor(strip_length-1, 0,0,255);
    break;
    case 3:
    strip.setPixelColor(0, 255,0,0);
    break;
    case 4:
    strip.setPixelColor(0, 0,255,0);
    break;
    case 5:
    strip.setPixelColor(0, 0,0,255);
    break;



  }





}


void modifycolour()
{
  switch (locus)
  {
    case 0:
    red1=constrain(red1+increment,0,255);
    break;
    case 1:
    green1=constrain(green1+increment,0,255);
    break;
    case 2:
    blue1=constrain(blue1+increment,0,255);
    break;
    case 3:
    red2=constrain(red2+increment,0,255);
    break;
    case 4:
    green2=constrain(green2+increment,0,255);
    break;
    case 5:
    blue2=constrain(blue2+increment,0,255);
    break;
  }
  basecolour = strip.Color(red1,green1,blue1);
  changecolor = strip.Color(red2,green2,blue2);
  
}

void increment_locus()
{
  if (millis()>t+buttonrate)
  {
    locus++;
    if (locus>5)
    {
      locus=0;
    }
    t=millis();
    blink_state=1;
    //blink_timer=millis();
  }
}


void stripgradient()
{

  for (int i=0; i<strip_length; i++)
  {
    colourdivisor = i/strip_length;
    strip.setPixelColor(i,divcolour(basecolour,changecolor,(i)));
  }

  
}


uint32_t divcolour(uint32_t colour_a,uint32_t colour_b,float divi)
{
  divi = divi/strip_length;
  divi=constrain(divi, 0, 1);

  unsigned int a_b =   colour_a & 0xff;
  unsigned int a_g =   (colour_a>>8) & 0xff;
  unsigned int a_r =   (colour_a>>16) & 0xff;

  unsigned int b_b =   colour_b & 0xff;
  unsigned int b_g =   (colour_b>>8) & 0xff;
  unsigned int b_r =   (colour_b>>16) & 0xff;

  unsigned int return_b = (a_b*divi) + (b_b*(1-divi));
  unsigned int return_g = (a_g*divi) + (b_g*(1-divi));
  unsigned int return_r = (a_r*divi) + (b_r*(1-divi));

  // "recalculate" using lookup table
  return_r=values[return_r];
  return_g=values[return_g];
  return_b=values[return_b];

  return strip.Color(return_r,return_g,return_b);
}
i made that. it was kinda good actually, was a nice effect and simple to use. tried to build a housing for it but when i was about 80% complete i discovered ue4 and gave up arduino

coding is simple man

echinopsis
Apr 13, 2004

by Fluffdaddy

pram posted:

i really like the spacecadet theme. it looks like a delicious blend of berries





monokai bright

love doze colours! bright is sexy and hot

Captain Pike
Jul 29, 2003

Please don't ever install node anything onto your desktop computer because that is just sad as gently caress.

Captain Pike
Jul 29, 2003

I'm the cocoa pods

Soldier of Fortran
May 2, 2009

pram posted:

i havent had to change anything because it looks perfect on osx. the multiple line editing is also from textmate, a great editor for osx (the worlds most advanced operating system) that is unfortunately dead

textmate 2 seems ok and not dead... suits my needs on osx (the worlds most advanced operating system) anyways

Captain Pike
Jul 29, 2003

quote:

textmate / sublimetext

Are you guys really 50+ years old and/or using linux/osx?

FamDav
Mar 29, 2008

pram posted:

i really like the spacecadet theme. it looks like a delicious blend of berries



get this golang out of yospos

rotor how are you letting this just happen

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

echinopsis posted:



monokai bright

love doze colours! bright is sexy and hot

i use this color scheme when i use sublime text

Valeyard
Mar 30, 2012


Grimey Drawer

echinopsis posted:



monokai bright

love doze colours! bright is sexy and hot

yeah this one is a lot nicer

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:
i use eclipse, its good ok tolerable i guess compared to other poo poo

Bloody
Mar 3, 2013

I use visual Studio whenever possible and when I can't I use the ides alternate editor support to use vim because iars text editor blows

Hed
Mar 31, 2004

Fun Shoe

echinopsis posted:



monokai bright

love doze colours! bright is sexy and hot

i'm the code that references color and colour in the same function

pram posted:

i really like the spacecadet theme. it looks like a delicious blend of berries



now with twice the antioxidant power

Max Facetime
Apr 18, 2009

rotor posted:

vim is for editing things when you're sshed in

no, this is wrong

when your ssh'ed in what you do is: scp the file over to your windows computer, open the file in a real ide, edit, save and scp the file back to the Linux

MrMoo
Sep 14, 2000

mosh + vim is where it is at.

bicycle
Oct 23, 2013
i have sublime and like it and its pretty but then i realized i pretty much just write up short scripts in vim while ssh'd in for 99% of my job responsibilities so now it is just expensive notepad

theadder
Dec 30, 2011


echinopsis posted:

it has the modern thing where it just saves everything isntantly without asking to save before closing.

os x forever

born on a buy you
Aug 14, 2005

Odd Fullback
Bird Gang
Sack Them All
lol if your vim config isn't in github so you just pull it down at every new job

Valeyard
Mar 30, 2012


Grimey Drawer

born on a buy you posted:

lol if your vim config isn't in github so you just pull it down at every new job

sublime works so you can host all your packages in a dropbox folder and then when you setup on a new computer you just point it there and it all syncs, its nice

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

born on a buy you posted:

lol if your vim config isn't in github so you just pull it down at every new job

this, but with your own private svn repo instead of supporting these clowns



also all your dotfiles and shell scripts and stuff

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Captain Pike posted:

You should all just read rotor's posts and do what he says.

Godspeed You! Black Conservative
Dec 30, 2006

by Fluffdaddy
dropping by to say lol if you don't use Xcode for IDE/textmate for other poo poo

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

pram posted:

i really like the spacecadet theme. it looks like a delicious blend of berries



yeah, dingleberries!!!

Ericadia
Oct 31, 2007

Not A Unicorn
sudo nano 4 lyfe

echinopsis
Apr 13, 2004

by Fluffdaddy
mixrosoft word

echinopsis
Apr 13, 2004

by Fluffdaddy

There Will Be Penalty
May 18, 2002

Makes a great pet!

Max Facetime posted:

no, this is wrong

when your ssh'ed in what you do is: scp the file over to your windows computer, open the file in a real ide, edit, save and scp the file back to the Linux

lmfao if your ide/editor/whatever doesn't support editing remote files

theadder
Dec 30, 2011


3g!!!!

echinopsis
Apr 13, 2004

by Fluffdaddy
oh no i cant nail those sick snipes

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

Kirk posted:

i use atom at work and i hate it

what are the shittiest parts?

BillWh0re
Aug 6, 2001


Atom's 2mb filesize limit means you can't open most logs or serialised data, god knows what part of the node stack is responsible for that

also the performance vs. sublime is pure poo poo

Bloody
Mar 3, 2013

even notepad can open a 2mb file

pram
Jun 10, 2001

BillWh0re posted:

Atom's 2mb filesize limit means you can't open most logs or serialised data, god knows what part of the node stack is responsible for that

also the performance vs. sublime is pure poo poo

lol what

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





i like brackets quite a bit but i only use it for html and css

Careful Drums
Oct 30, 2007

by FactsAreUseless

rotor posted:

this, but with your own private svn repo instead of supporting these clowns



also all your dotfiles and shell scripts and stuff

thanks i almost forgot how douchey they are

use visual studio + vsvim

Careful Drums
Oct 30, 2007

by FactsAreUseless

BillWh0re posted:

Atom's 2mb filesize limit means you can't open most logs or serialised data, god knows what part of the node stack is responsible for that

also the performance vs. sublime is pure poo poo

its the part where every nodejs application doesn't work on windows because the dependency tree isn't flattened and breaks the maximum file path length

Share Bear
Apr 27, 2004

arguing about tools probably turns people off from starting programming

so what im saying is you should all use vim for everytthing

Adbot
ADBOT LOVES YOU

BillWh0re
Aug 6, 2001


Careful Drums posted:

its the part where every nodejs application doesn't work on windows because the dependency tree isn't flattened and breaks the maximum file path length

im on a linux though, its just poo poo



apparently they raised it from 1mb, maybe in the hope that moore's law would do the rest

https://discuss.atom.io/t/2mb-limitation-makes-for-a-horrible-first-impression/3286

  • Locked thread