If you just want the font and be on your way: Here it is
In past lives I have done a lot of work with barcodes. Usually, because it's a job, I could fund getting actual good barcoding plugins to get the job up and running quickly. I have done a lot of searching for free ways to make barcodes and they do exist and some are quite good. However, they always end up costing time instead of money. But you could say that about the ones that aren't free as well. Recently I had the need to get a barcode in Excel. Which first off why does Excel not have barcode support out of the box! Or off the disc as it were. I mean if they had just spent all the time they wasted making Clippy and added functionality that people could actually use... Anyway, I did in fact track down an good, very free, barcode font for 3of9. I don't know that I have ever used a barcode scanner that didn't read 3of9. It's not the slimmest of barcode options but it's free and you can get barcodes added to a document or in a project quickly. So I thought I would share it.
Thursday, September 26, 2013
Monday, August 5, 2013
Arduino Tutorial - Quick and Dirty Blink Without Delay
I was writing a sketch for a project I am working on and I needed to add a blinking cursor on a character. My first thought was on how many new variables would need to be added to keep track of state and time between states and the time since the last change. It's not a big deal but it seems like a lot just for a little bit of the on off on off. I had just been working with bitRead() on a different problem and the light blub flicked on that I could use that to watch a bit of millis() and use the toggling of the bit as my on/off switch.
The easiest way to demonstrate this is with the Blink sketch.
So then you've got the BlinkWithDelay Sketch:
Now if you care for a bit of explaining you can read on.
bitRead(data, n) will take the data and put out the n-th bit from it. So bitRead(B00001000, 3) would return 0 and bitRead(B00001000, 4) would return 1.
millis() gives the number of milliseconds since the sketch started. After 3 seconds of running millis() would return 3000. So every 1ms the first (from the right) bit of millis() would flip. After every 2ms the second bit would flip, 4ms the third, 8ms the forth and so on. This lets you get an equal beat without a lot of code.
As a bit of a bonus (pun intended) if you check the 9th bit and the 8th bit in the if statement you will get a longer on then off period. I was able to get a uniquely blinking cursor by checking the 9th bit and the 7th bit. There is a brief on period and then a Double Flash.
The easiest way to demonstrate this is with the Blink sketch.
const int led = 13;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}
This is what you get from the Arduino IDE built-in Blink sketch. The issue with this that makes it almost useless code, other than for learning, is that nothing can happen during those delays. Each delay is 1 second your project will be doing nothing.
So then you've got the BlinkWithDelay Sketch:
const int ledPin = 13;
int ledState = LOW;
long previousMillis = 0;
long interval = 1000;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop()
{
unsigned long currentMillis = millis();
if(currentMillis - previousMillis > interval)
{
previousMillis = currentMillis;
if (ledState == LOW)
ledState = HIGH;
else
ledState = LOW;
digitalWrite(ledPin, ledState);
}
}
Now that ends up with 3 variables and some logic for tracking. Again, not a big deal and pretty easy to follow what's going on. But if you just need repetitive high low action then here is what you can do to get it quick and easy:
const int led = 13;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
if(bitRead(millis(),10) == 0)
{
digitalWrite(led, HIGH);
)
else
{
digitalWrite(led, LOW);
}
}
That's it, just replace the delays with an if/else statement checking the 10th bit of the unsigned long returned from millis() and you will get about a 1 second delay. It's ease starts to degrade when you need more control over the blinking interval but if you want an even tempo flash then this will get the job done. Now if you care for a bit of explaining you can read on.
bitRead(data, n) will take the data and put out the n-th bit from it. So bitRead(B00001000, 3) would return 0 and bitRead(B00001000, 4) would return 1.
millis() gives the number of milliseconds since the sketch started. After 3 seconds of running millis() would return 3000. So every 1ms the first (from the right) bit of millis() would flip. After every 2ms the second bit would flip, 4ms the third, 8ms the forth and so on. This lets you get an equal beat without a lot of code.
As a bit of a bonus (pun intended) if you check the 9th bit and the 8th bit in the if statement you will get a longer on then off period. I was able to get a uniquely blinking cursor by checking the 9th bit and the 7th bit. There is a brief on period and then a Double Flash.
unsigned long time = millis();
if(bitRead(time,9) == 0 && bitRead(time,7) == 0)
Thursday, August 1, 2013
Free Shipping on Raspberry Pi Model B orders.
From now through Monday August the 5th, while supplies last, orders for the Raspberry Pi Model B will have free shipping. Just use the coupon code: "blogfs0813" at checkout. Be sure to let people know. Spreading the word on our promotions help us keep doing them.
Thursday, July 25, 2013
$0.99 Electronics Deal - Raspberry Pi Camera Board Module
Raspberry Camera Module for $0.99.
Let's try this again, shall we? Let's do it with a brand new item that is quite popular right now. For all you Raspberry Pi owners out there we are going to give you a chance to get your hands on the Camera Module for $0.99(shipping not included). A coupon will be sent out from @atomsindustries twitter account at some random time in the coming days. The coupon will bring the price for the Camera Module down to $0.99 and will only be good once. So only one person will get to use it. You'd better follow @atomsindustries and be ready to react when it happens.
Do you already have the Camera Module? Leave a link to your project or just your idea for one in the comments to give some people ideas of what can be done with one.
Friday, July 12, 2013
Wrapping up the Raspberry Pi Model A Promo
Well
all has gone according to our lack of a plan. The promotion was
claimed for the Raspberry Pi Model A 256MB and it will be on its way out
the door shortly. The process was fun and we have some ideas about
similar but different promotions in the near future. Items with lesser
"Cha-ching" value than this, but some with more! Some to be promoted
before hand and others to just pop up randomly. So be sure to follow us
@atomsindustries and keep your eyes peeled,
they won't always follow the same format.
Tuesday, July 9, 2013
$0.99 Electronics Deal - Raspberry Pi Model A 256MB
This is an experimental promotion. Hopefully it all works out...but it will only
work out for 1 person 1 time. Sometime
in the next few days a coupon code will be sent from the @atomsindustries
twitter handle that will discount a Raspberry Pi Model A 256MB down to $0.99 on
www.AtomsIndustries.com. The coupon is only good for one use so the first one that
gets their order in gets it. So be sure to follow us so you can react as fast a possible. Assuming everything works out. Who knows, that's
why it’s an experiment. No one but Atoms Industries employees will know the
date and time and we don't even know exactly yet. But I can tell you that it
will be after yesterday.
You will still have to pay shipping though, so don't just
show up with a dollar and a dream.
Disclaimer: A Raspberry Pi is a non-perishable credit card
sized computer and should not be eaten under most if not any circumstances.
Subscribe to:
Posts (Atom)