Show Posts
Pages: [1] 2 3 ... 10
1  Topics / Device Hacking / Re: Use OKI Microline printer with arduino? on: September 07, 2014, 05:35:00 am
I've got some requests about this code, so here it is, the ASCII printer code!
2  Using Arduino / Programming Questions / Re: Simple question; possible to pick the last float digit? on: June 11, 2014, 03:05:01 pm
Oh, this is SO embarrassing! I should have known that! Thanks! smiley
3  Using Arduino / Programming Questions / Simple question; possible to pick the last float digit? on: June 11, 2014, 02:43:25 pm
Hi!
I got a decimal number, 28.14 .
I want to mane a method that returns the last decimal digit, in this case, 4!
how can I do so?
4  Using Arduino / Programming Questions / Re: SD card problems on: June 07, 2014, 11:55:52 am
I got it working with the 16GB card, but it won't read 32MB, 64MB and 512MB. Does anybody knows the upper and lower card size? This card is supposed to contain one single .txt file, so 32MB is actually plenty of space!
5  Using Arduino / Programming Questions / SD card problems on: June 07, 2014, 07:10:29 am
Hi! I have an SD card reader for my Arduino, a cheap one from Ebay: http://www.ebay.com/itm/170895501953.
I've tested it before, and It worked perfectly then. Yesterday I hooked up the card reader to my Arduino UNO, and uploaded the Card Info sketch. I have triple checked the connections, also the chip select pin.

I have also tried with multiple cards, 32MB, 512MB and 16GB, but with no luck.
My cards are formatted in FAT32, and the library is supposed to support it.
This is my error message:

Initializing SD card...initialization failed. Things to check:
* is a card is inserted?
* Is your wiring correct?
* did you change the chipSelect pin to match your shield or module?

How can I get the Arduino to communicate with the SD card?
6  Using Arduino / General Electronics / Read an electronic signal from a music amplifier without affecting it on: April 05, 2014, 07:01:47 am
Hi!
I just built an Amplifier for my home theatre subwoofer, and I'm quite happy with it. The only problem is that I'll manually have to turn it on and off, while the commercial ones have a sort of "auto detecting" the music signal.

I've been using Arduino for quite some time now, and I know how to use analogRead to measure voltage levels.
The difference is that I don't want the Arduino to affect the signal in any way. Is it possible to build an electronic circuit that will achieve these criteria?
7  Using Arduino / Microcontrollers / Re: Atmega 168 And ATmega8 on Arduino UNO on: March 27, 2014, 08:00:01 am
Don't listen to them! If you have an UNO with a removable Atmega328, you can place an Atmega8 or Atmega168 instead of the original Atmega328p. These microcontrollers have the same pinout, and there exist Optiboot bootloaders for all of them.
Optiboot is just an optimized bootloader that is faster and does not require more than 512b of memory.

I've used atmega8 a lot in small projects that doesn't require more space than 8kb. You can of course use the original ATmega8/168 bootloader, but I strongly recommend Optiboot.
You just place the atmega8/168 into the UNO board, choose the right board/bootloader under the Tools > Boards menu, and clock "Burn bootloader". You'll also need an ISP programmer, such as USBasp, AVRisp or an Arduino ISP.

take a look at post no. 3 in this topic. I wrote a small guide to get started.
8  Using Arduino / Programming Questions / Re: For-loop inside if statement - possible? on: March 26, 2014, 01:36:47 pm
Yes, Basically I want to compare two arrays. I've never used memcmp() before. Is there a different syntax compared to c++?
9  Using Arduino / Programming Questions / For-loop inside if statement - possible? on: March 26, 2014, 12:43:26 pm
Hi!
I'm working on a RFID project, where I've scan an RFID card, and saved its unique ID into an array.
I want the Arduino to recognize multiple RFID cards, so I've created some arrays to check what card have been scanned..

I got these arrays, and when I scan a card, the ID is stored into the UniqueID array.
Code:
byte keyChain[4] = {0x4D, 0x9A, 0xE2, 0xEA};
byte creditCard[4] = {0x25, 0x30, 0xFD, 0x2B};
byte UniqueID[4];

I've been using this to check what card have been scanned:
Code:
   
         if(UniqueID[0] == creditCard[0] && UniqueID[1] == creditCard[1] &&
                UniqueID[2] == creditCard[2] && UniqueID[3] == creditCard[3]) {
                Serial.println("");  
                Serial.println("Creditcard scanned!");
                Serial.println(" ");
                digitalWrite(14, HIGH);  
                delay(1000);
                }

As you can see this code is a bit hairy, and I want to make it smaller and more elegant if that's possible.

I was thinking something like this, but I can't figure how to get it to work! Is it possible to write it this way?
Code:
               if( for(int i = 0; i<4; i++) { creditCard[i] == UniqueID[i]; } )
                  { doSomeStuffHere(); }
10  Using Arduino / General Electronics / Measuring RTC backup battery; How much current will an arduino draw ? on: February 09, 2014, 03:41:07 pm
Hi!
I'm working on a door logging machine that displays time on a a display.
I'm using a DS1307 with a backup battery.
I want the Arduino to constantly measure the voltage left on the little backup battery, and write on the screen when the voltage is critically low.

I know how I measure voltage, but  will this draw a noticeable amount of current from the battery?
I want the little button cell to last as long as possible.
11  Using Arduino / Programming Questions / Re: Can Arduino handle 8 bit ASCII? on: November 07, 2013, 06:40:31 am
the printer can handle norwegian characters, and if I for example want to print the character Å, I send the decimal value 148, and tell the printer to print. The problem is that I can't figure figure out how to convert a special character  to ascii values above 127
12  Using Arduino / Programming Questions / Can Arduino handle 8 bit ASCII? on: November 07, 2013, 05:45:02 am
Hi! Is it possible to use 8-bit ASCII characters with the Arduino?
I'm currently interfacing with an old parallel printer that support 8-bit ASCII, but I cant print special norwegian
characters like "æ, Æ, ø, Ø, å, Å.

Ofcource I can for the printer to print just one Character at the time, by sending the ASCII decimal value, but I want the Arduino to convert a sentence like "Dette er en test på norsk!"  and send it right out to the printer.

I'm using a shift shift register to feed the printer, and the code looks like this:

Code:
void printChar(char* value) {
    while (digitalRead(busy) == HIGH) {}   
    String mystring(value);
    for (int i = 0; i < 20; i++) {  //i should be larger than upper bound
        digitalWrite(latchPin, LOW);
        shiftOut(dataPin, clockPin, MSBFIRST, mystring[i]);   
        digitalWrite(latchPin, HIGH);
        digitalWrite(strobe, LOW);
        delay(2);
        digitalWrite(strobe, HIGH);
        delay(5);
     }   
  while (digitalRead(busy) == HIGH) {}   
}
13  Using Arduino / Programming Questions / Re: Diffrece between byte and uint8_t in functions on: October 26, 2013, 08:17:36 am
So does that mean that uint8_t and uint16_t is universal to all (most) C/C++/C# compilers?
So with the arduino compiler uint8_t and byte are the same, and uint16_t and int are the same.
I'll think i'll stick with the uint_t variant, since we're going to program in C# the next semester at school. Better keep it universal smiley-wink
14  Using Arduino / Programming Questions / Diffrece between byte and uint8_t in functions on: October 26, 2013, 08:08:28 am
Hi! Just a quick question:

What's the diffrence between using "byte" and using "uint8_t in functions?
I've discovered that this function works with both, but I've seen a lot of people using uint8_t instead of byte.

Code:
void ledBar(uint8_t value) {
    digitalWrite(led_latchPin, LOW);
    shiftOut(led_dataPin, led_clockPin, MSBFIRST, value); 
    digitalWrite(led_latchPin, HIGH);
   }

Compared to

Code:
void ledBar(byte value) {
    digitalWrite(led_latchPin, LOW);
    shiftOut(led_dataPin, led_clockPin, MSBFIRST, value); 
    digitalWrite(led_latchPin, HIGH);
   }
15  Using Arduino / Programming Questions / Re: make rotary encoder code stop at a given value on: October 22, 2013, 04:33:03 pm
aw! I didn't inspect the library very well, so I didn't realize there was a write function!
The code now works like a charm smiley-grin Thanks a lot for your help! smiley
Pages: [1] 2 3 ... 10