Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / Displays / U8glib custom font and displaying different sizes on 128x64 oled display on: September 02, 2014, 03:56:13 pm
Hi, I have a couple questions.. I'm trying to print letters and numbers to an adafruit 128x64 monochrome oled display.  I notice when I set one font with u8glib, the sketch size is huge(14k). I have plenty more code that I need to add. Leads me to think a custom font with only the characters I need is the way to go.

 I see there is some info on here and on the web, but I'm having issues.  I have font forge.  Seems pretty easy to use.  I tried simply creating a new font and copying the characters I need from another font to the new one, but no joy. 

The size of the font is another issue.   I wanted to print some letters larger than others.  I don't like the idea of scaling a smaller font up.  Hoping a larger font could be scaled down and look ok.

If anyone has done anything similar, some help would be greatly appreciated. 

Thanks!

2  Using Arduino / Networking, Protocols, and Devices / Re: AD5175 i2c digital pot issues on: August 21, 2014, 11:55:04 pm
Hi, yes I'm using pull up resistors on both to 5v.  Powering the ad5175 with 5v as well. I'll report back asap.  I'll also try an external power supply vs usb. Thanks!
3  Using Arduino / Networking, Protocols, and Devices / Re: AD5175 i2c digital pot issues on: August 21, 2014, 04:37:14 pm
Hi,

Thanks for the reply.  Makes sense.  Unfortunately, even the test didn't work. still 5k.  I don't have the 10uf cap between vdd and grnd, only .1uf.  Think that would do it?

i2c scanner shows address of 47.

I ran out of time today, but hopefully this weekend I can take another crack at it with the 10uf cap.

Thanks again,

Mark
4  Using Arduino / Networking, Protocols, and Devices / AD5175 i2c digital pot issues on: August 21, 2014, 01:56:12 pm
Hi, I'm looking for someone that has used the ad5175 digital pot with arduino before.  I see a couple people did on here, but didn't go into any detail about how they got it working.

I ran an i2c scanner, and it's finding the ad5175.  All I'm getting out of the wiper is 5k, which from the datasheet normal(at 50%).
I'm running the code from this example, but I changed the max val to 1024 to match the ad5175.  Still should work, right?

Code:
// I2C Digital Potentiometer
// by Nicholas Zambetti <http://www.zambetti.com>
// and Shawn Bonkowski <http://people.interaction-ivrea.it/s.bonkowski/>

// Demonstrates use of the Wire library
// Controls AD5171 digital potentiometer via I2C/TWI

// Created 31 March 2006

// This example code is in the public domain.

// This example code is in the public domain.


#include <Wire.h>

void setup()
{
  Wire.begin(); // join i2c bus (address optional for master)
}

byte val = 0;

void loop()
{
  Wire.beginTransmission(47); // transmit to device #47
                              // device address is specified in datasheet
  Wire.write(byte(0x00));            // sends instruction byte 
  Wire.write(val);             // sends potentiometer value byte 
  Wire.endTransmission();     // stop transmitting

  val++;        // increment value
  if(val == 1024) // if reached 1024th position (max)
  {
    val = 0;    // start over from lowest value
  }
  delay(500);
}
5  Using Arduino / Microcontrollers / Re: Arduino pro micro atmega32uf no aref pin? on: August 17, 2014, 08:15:08 pm
After reading more, I see this just won't work for the accuracy I need... Will wait for lm4040's to arrive. 
6  Using Arduino / Microcontrollers / Re: Arduino pro micro atmega32uf no aref pin? on: August 17, 2014, 07:57:09 pm
Honestly, I'm not 100% on how things will end up working out with this project... If I use 3s lipo @ 11.1v, I can use a lm7805 voltage regulator or to power the arduino.  That would work, I believe.  Right now I'm using two 18650 lion 3.7v batteries in series and with the load I'm putting on them they will definitely get under the 7v required for the 7805(I believe it's 7v).  Fully charged = 8.4v or so and I don't want to discharge them lower than 6.4v.

If I used the regulator with the 3s lipo(or 18650lion), I may be able to get away with using 5v lm7805 as a reference.  I'm going to sleep on this tonight.  This is a project for fun so trying to keep the cost down.  Already have the 18650's.  I have enough to put 3 in series, so maybe I can test with that.  I already have the 7805 regulators.  I see the datasheet says 4.8-5.2v, so that may not work... I'll have to test it with my setup.

1% accuracy would do me just fine with this project.

Thanks again for all you help.  I pressed + karma, but it only let me do it once....
7  Using Arduino / Microcontrollers / Re: Arduino pro micro atmega32uf no aref pin? on: August 17, 2014, 06:41:55 pm
I think I just needed to take a break.  I get it now. Thanks so much for the explanation.  I scored a couple of these.  Hopefully will be here tomorrow. smiley

http://www.ebay.com/itm/310943494516?_trksid=p2059210.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

My voltage will be between 6.4-8.4v

So if I have this right to find R

R =6.4-4.096/0.528=4.3k
 
Max current will be

8.4-4.096/4.3=1ma

Look correct?

8  Using Arduino / Microcontrollers / Re: Arduino pro micro atmega32uf no aref pin? on: August 17, 2014, 05:27:30 pm
You mean the lm4040 is $5?  I was planning on using the filter cap that's already there like you were saying. I have some other 100nf caps as well.  I think I can solder a wire without glue or anything.  

I'm reading the lm4040 datasheet, and how they come up with the resistor is a little over my head atm.  Page 25-26.  They have an example there with 909ohm resistor.  Page 25 has the calculation for it.

Here's more info.  I really want to understand all this..  

http://www.skillbank.co.uk/arduino/measure.htm
9  Using Arduino / Microcontrollers / Re: Arduino pro micro atmega32uf no aref pin? on: August 17, 2014, 04:32:15 pm
Thanks for the replies. smiley  I do need something more accurate than 5%, hence the lm4040-4.1.  What do you think?  Looks like the little cap on aref pin in just a filter.  I can solder to it just fine on the correct side and use it, I believe.


10  Using Arduino / Microcontrollers / Re: Arduino pro micro atmega32uf no aref pin? on: August 17, 2014, 02:55:40 pm
I looked at pin 42 and it does go to a little cap. can't really see what's after that.  I'm using an lm4040 voltage reference diode for an analog reference so I can get precise voltage from batteries.  Everything else the pro micro can do is great for me.  This, so far, is the only problem.  

I've read that the internal 2.56v voltage reference only has accuracy to +/-5%.  I need it to be more accurate.  I'm googling info on soldering to the cap, and can't find any info.  Tried different searches.

would you just solder a wire to the cap like it was a pin and set analogreference(external)?
11  Using Arduino / Microcontrollers / Re: Arduino pro micro atmega32uf no aref pin? on: August 17, 2014, 01:02:13 pm
Yes, it's one just like the sparkfun one.  I need one as small as possible, as it's going in a tiny box.  I'm going to check that out, thanks.  I have a nano 3.0 as well that I may use.  I appreciate the help.
12  Using Arduino / Microcontrollers / Arduino pro micro atmega32uf no aref pin? on: August 17, 2014, 11:43:22 am
Title says it all. I don't see an aref pin on here and I really need it.  Is there a workaround to connect to pin 42(aref)?
13  Using Arduino / Displays / Re: Best approach for 128x64 OLED graphical battery level indicator[solved] on: August 15, 2014, 02:45:49 pm
For anyone reading this, I ditched the original idea of using only 5 battery levels.  The percentage of the battery bar that will be displayed is the actual percentage of the battery level within a given range.

(BattVoltage-BattMin)/(BattMax - BattMin) * 100 = BatteryPercentage

Since we know the battery percentage(lets say 50%, for example)and battery bar will be 30 pixels long, we can figure out how many pixels the battery level should be at 50%.

(batteryPercent*MaxBatteryBar)/100 = 15(battery bars pixels)

(50*30)/100=15 pixels.  After the calculation, we can draw the correct length of the battery bar to the display .

Hopefully you can understand this and it'll help someone. smiley
14  Using Arduino / Displays / Re: Best approach for 128x64 OLED graphical battery level indicator[solved] on: August 14, 2014, 03:18:01 pm
I used the Hello World example, hence the extra code in there. Have a good day everyone.
15  Using Arduino / Displays / Re: Best approach for 128x64 OLED graphical battery level indicator[solved] on: August 14, 2014, 03:16:54 pm
Hi, thanks for the reply. I ended up using u8glib.  I highly recommend it. smiley  Had the full battery indicator done in about 10 minutes.  Barely any code.  Friggin' awesome. 
Code:
#include "U8glib.h"

U8GLIB_SSD1306_ADAFRUIT_128X64 u8g(9, 10, 15, 14); // SW SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9

void draw(void) {
  // graphic commands to redraw the complete screen should be placed here 
  u8g.setFont(u8g_font_unifont);
  //u8g.setFont(u8g_font_osb21);
  u8g.drawFrame(99,0,27,10);
  u8g.drawBox(101,2,23,6);
  u8g.drawBox(126,3,2,4);

}

void setup(void) {

  u8g.getMode() == U8G_MODE_BW;
    u8g.setColorIndex(1);         // pixel on
  }
void loop(void) {
  // picture loop
  u8g.firstPage(); 
  do {
    draw();
  } while( u8g.nextPage() );
 
  // rebuild the picture after some delay
  delay(50);
}
Pages: [1] 2 3 ... 6