Loading...
  Show Posts
Pages: 1 [2] 3 4 ... 9
16  Using Arduino / Programming Questions / Re: int and unsigned int on: October 07, 2012, 04:45:25 am
Ok.
17  Using Arduino / Programming Questions / int and unsigned int on: October 07, 2012, 04:17:48 am
Hello all,

This is probably a silly question but am going to ask it. I thought an int was 16bits long but when i print out a int value in the serial monitor as binary i can see 32bits. If i change the value to unsigned int i then see just 16bits. Why is this? Is it because the int type can hold a negative number but the unsigned int can't?

Thanks.
18  Community / Website and Forum / selling? on: October 06, 2012, 11:14:13 am
Hi all,

Does the forum allow posts about selling components? A section for people to sell unwanted components may not be a bad idea.
19  Using Arduino / Microcontrollers / ATmega324 on: October 05, 2012, 07:01:42 am
Hello everyone,

Sorry if this has been covered before but after googling not much info came up. Am finding that i don't have enough pins with the Arduino UNO but the Arduino MEGA is far to many so is it possible to use the ATmega324 in the same way i use the Arduino UNO with the Arduino IDE?

Thank you.
20  Using Arduino / Networking, Protocols, and Devices / Re: Trying to understand the CAT9532 i2c IC. on: October 05, 2012, 05:09:10 am
Ok thats great. Hmmm, i don't need all the blink stuff so might be better going for a basic i2c expander chip for eaiser coding.

Thanks.
21  Using Arduino / Networking, Protocols, and Devices / Trying to understand the CAT9532 i2c IC. on: October 05, 2012, 03:09:53 am
Hello all.

Am trying to understand how to use the CAT9532 IC so hope someone can help. Am i correct in thinking that you have to send 2 bits of data per i/o pin and can i send a big hex number to control all 16 i/o's in one transmission for example 0x55555555 (to turn all outputs on) or do you have to split it down to 4bytes?

http://www.onsemi.com/pub_link/Collateral/CAT9532-D.PDF

Thanks.
22  Using Arduino / General Electronics / Re: MAX7219 in the UK. on: October 02, 2012, 03:11:18 pm
In general i would like to buy from the UK but looking at this i may start buying from overseas.
23  Using Arduino / General Electronics / Re: MAX7219 in the UK. on: October 02, 2012, 03:08:16 pm
This is very silly. Tayda - 1 x MAX7219 with 7 - 16 day delivery($0.99) to the UK $2.24.
24  Using Arduino / General Electronics / Re: MAX7219 in the UK. on: October 02, 2012, 03:02:49 pm
The stupid thing about Farnells UK is that when your looking at the items it shows you items in the USA for next to nothing. But if you look at the same item in stock in the UK the price is 8 times more lol. In the UK a MAX7456 is £20 from Farnells.
25  Using Arduino / General Electronics / MAX7219 in the UK. on: October 02, 2012, 02:52:20 pm
Simple question for people that use the MAX7219 in the uk. Where is the cheapest place that you all have found for them? Farnells is £10 for 1 and that is very expensive.
26  Using Arduino / Displays / Re: Video Amplifier Circuit Doing the Opposite! on: October 01, 2012, 03:33:51 pm
MAX4213, EL5050 for you to start with and you will need 1 for every video output. http://www.maximintegrated.com/ have lots of good info about designing what you want to do in the product video section http://www.maximintegrated.com/products/video/ and also try google for video distribution amplifiers (VDA).
27  Using Arduino / Programming Questions / Re: Bitshift help. on: October 01, 2012, 03:07:31 pm
I have managed to create the following test sketch to simulate my real program and try to implement the gear shit indicator led flash. The timings have been slowed down for easier reading in the serial monitor.
Code:
byte temp;
byte Display_RPM;
byte ShiftIndicator = 5;
unsigned long result = 6902;

long previousMillis = 0;

byte flash(long Interval)
{
  long currentMillis = millis();
  if(currentMillis - previousMillis > Interval)
  {
    previousMillis = currentMillis;
    return 1;
  }
  else
  {
    return 0;
  }
}

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  temp = result/1000;
  Display_RPM = ~((1 << (8 - temp)) -1);
  if(temp >= ShiftIndicator && flash(1000) == 1)
  {
    bitSet(Display_RPM, 0);
    Serial.println(Display_RPM, BIN);
  }
  else
  {
    Serial.println(Display_RPM, BIN);
  }
  delay(900);
}
Is there a better way todo this or is this ok? The useful thing is that i can use the flash routine for other things too.
28  Using Arduino / Programming Questions / Re: Bitshift help. on: October 01, 2012, 12:49:04 pm
Ok cheers. Is bit set good to use here or keep using the << stuff? Am just trying to work out a routine now.
29  Using Arduino / Programming Questions / Re: Bitshift help. on: October 01, 2012, 02:01:18 am
Ok thanks alot. So i have 2 options of code to use

1 - the lookup table
or
2 - the bitshift function

is one better then the other or just personal preference? I will be using the i2c driver for my display and this RPM stuff is just the start of it. I now need to find out the best way to flash the last "on" LED in 11111000 if a variable has been set to 5 or if the variable has been set to 6 flash the last "on" LED in 11111100.
30  Using Arduino / Programming Questions / Re: Bitshift help. on: September 30, 2012, 04:13:21 pm
Quote
Code:
  b = 1 << 1 | 1;
use instead:


Code:
  b = (b << 1) | 1;
to produce 0b00000001 -> 0b00000011 -> 0b00000111 ...

or

Code:
  b = (b >> 1) | 0x80;
to produce 0b10000000 -> 0b11000000 -> 0b11100000 ...;

This is also considerably faster.
dhenry, i have tested what you have said and it doen't work.
Pages: 1 [2] 3 4 ... 9