Show Posts
Pages: [1] 2 3 ... 7
1  Using Arduino / Programming Questions / Re: 8 Bits to byte -> how? on: December 23, 2013, 04:13:39 pm
Thank you

I tried and ended with this :

Code:

int array[]={1,0,1,1,0,1,0,1};

void setup() {
  // initialize serial:
  Serial.begin(9600);
 

}

void loop() {
  byte value = 0;
for (int i = 0; i < 8; i++) {
  // trigger the clock pin and wait.
  if (array[i])
    value |= (1 << i);
}
  Serial.println(value);
  delay(1000);
}

Which works for me. Thank you all!
2  Using Arduino / Programming Questions / Re: 8 Bits to byte -> how? on: December 23, 2013, 03:55:03 pm

byte b = R1 << 7 + r2 << 6+ r3 << 5 + r4 << 4 + r5 << 3 + r6 << 2 + r7 << 1 + r 8;


This doesn't work for me, its always 0 smiley-sad
3  Using Arduino / Programming Questions / Re: 8 Bits to byte -> how? on: December 23, 2013, 03:39:38 pm
I can also do it with bits, I think thats easier.

I have those 8 values

Code:
int R1=1;
int R2=0;
int R3=1;
int R4=1;
int R5=1;
int R6=0;
int R7=1;
int R8=0;

How do I convert those values to one byte?
4  Using Arduino / Programming Questions / 8 Bits to byte -> how? on: December 23, 2013, 03:27:50 pm
Hi!

I do have 8 Boolean values which should be converted to 1 byte. how can I do that?

like 10111010 -> 186

Background, I have to send those 8 bytes via Serial to a relays Card


tsaG
5  Products / Arduino Due / Using the TLC5947 with the Arduino Due on: October 24, 2013, 02:59:43 pm
Hi!

I want to use the TLC5947 with my Arduino due. I already found the Octobrite library but it turned out to work with AVR Chips only. Does anyone know how to interact with this chip? I just want to set something like turn on LED 1 2 5 7 .... pretty simple. Does anyone know how to do this?

These are my connected pins:
Code:
#define data   11
#define clock   13
#define latch   9
#define oe  10


-Patrick

EDIT: I already tried to use the Adafruit library ( https://github.com/adafruit/Adafruit_TLC5947 ) but it stops immediately after sending the command.
6  Products / Arduino Due / Due + touchscreen + camera on: July 19, 2013, 09:08:49 am
Hi,

Im about to program an touchscreen Interface using the GUI lib by cowasaki. Works Fine so far. Now i want to Display the camera Stream in the GUI.

Im using this Screen

http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=111008432389

As far as I know there are Chips which can overlay (something like a hud) over a picture Stream, but Most of them use the Pal or NTSC Signal... Is there something similar "digital"?

My first thought was to use a Chip as Switch between the arduino and camera, but then I couldnt Display the GUI..

I have no Idea which camera to use, just that the resolution should be somewhere around the Displays Resolution (800x480)


-tsaG
7  Using Arduino / LEDs and Multiplexing / Re: ShiftPWM support topic. Latest update: Schematics, high power LED's, LED strips on: May 10, 2013, 05:14:18 pm
Hi,

I get errors while using this with the DUE, so I guess its not ready yet. Any date when its done? Or are there any simple steps to make it work?
My Goal is to have Duo LEDs Shiftpwmed on the DUE smiley
8  Using Arduino / Microcontrollers / Re: Selfmade Due running way to slow on: May 09, 2013, 02:54:11 pm
Sorry for doupleposting, but could anyone look on their Due to tell me which Crystal is installed? I read several Threads where it says there is an 16mhz Crystal, which would explain the whole thing here.
9  Using Arduino / Microcontrollers / Re: Selfmade Due running way to slow on: May 09, 2013, 02:46:19 pm
But the Due also uses an 12mhz fast and 32.768 Slow Crystal  smiley-sad
http://arduino.cc/en/uploads/Main/arduino-Due-schematic.pdf
10  Using Arduino / Microcontrollers / Re: Selfmade Due running way to slow on: May 09, 2013, 01:22:12 pm
Hi,

thanks for the fast response. Im using an 12mhz and 32.xxkhz Crystal. The Sam3x8e doesnt use Optiboot.
Also, I cant find the Fuse settings, the only bits I can set are the GPNVM and Lockbits.
Where do I have to look? Do I need any other external tools?
11  Using Arduino / Microcontrollers / Selfmade Due running way to slow on: May 09, 2013, 11:03:51 am
Hi!

I build my own Due Board (kind of). I programmed it using an J-Link (SWD). My first try was uploading the Blink sketch. When trying to Blink with Output Digital 50, it way to slow! When I set the Sketch to have an Intervall of 1 sec, the Due actually takes 6 sec to do it!

I uploaded the sketch (as I said) using my Segger J-Link and AtmelStudio with the Arduino DUE Project file selected. What could that be? are there any fuses I need to set?
12  Using Arduino / Project Guidance / Re: Arduino based PCB - layout, crystal and planes on: March 30, 2013, 06:46:35 pm
Hi,

As already mentioned try to use supply or ground planes, they make routing more easy and also shield the lanes.

I manufactured my pcbs at eurocircuit. They're fast and even offer Support in german Language.
Also, they do have some interisting Manuals about layouting. Give it a try!


Grüße aus Bremen

-tsaG
13  Using Arduino / Project Guidance / Re: Controlling a rs-232 Relaisboard via web on: March 30, 2013, 09:35:54 am
Hi!

Thanks for your reply. Yes, the Board is crappy designed but I just got 4 of them for free, so I wanted to give it a try smiley-grin

I managed to get it to work.

There is an Attiny2313 on the board to set the Relais. I already tried to flash the Attiny but it doesnt really work out, so I flashed it back.

The reason why it didnt work to use the RX/TX Output directly on the boards connection is the MAX232 Chip. I soldered my wires directly to the Attiny 2313 and it worked!

Here is my function I used (using Myserial)


Code:
void sendCommand(int command, int cardAddr, int data){
  byte bytes[4];
  bytes[0] = byte(command);
  bytes[1] = byte(cardAddr);
  bytes[2] = byte(data);
  bytes[3] = bytes[0] ^ bytes[1] ^ bytes[2];

  writeBytes(bytes,4);
  delay(250);
}

void writeBytes(byte arr[], int len){
  for(int i = 0; i < len; i++){
    mySerial.write(arr[i]);
  }
}

First you have to Initialise them (1.0.0) then Set them (3.0.x). Works good.

The next step is Adding the Webserver capability. I already tested it using the simpled Webserver youll find when googling "ArduinoWebServerLED".
I wanted to use the SDcard to store my Website, but how can I do that? I already found "TinyWebServer" but even the examples it wont compile smiley-sad

Code:
SimpleWebServer.ino:11:19: warning: Flash.h: No such file or directory
SimpleWebServer.ino: In function 'boolean index_handler(TinyWebServer&)':
SimpleWebServer.ino:38: warning: only initialized variables can be placed into program memory area
SimpleWebServer:38: error: no match for 'operator<<' in 'web_server << (const __FlashStringHelper*)({...})'
SimpleWebServer.ino: In function 'const char* ip_to_str(const uint8_t*)':
SimpleWebServer.ino:48: warning: embedded '\0' in format
SimpleWebServer.ino: In function 'void setup()':
SimpleWebServer.ino:54: warning: only initialized variables can be placed into program memory area
SimpleWebServer:54: error: expected `)' before 'FreeRam'
SimpleWebServer:54: error: expected `)' before ';' token
SimpleWebServer.ino:72: warning: only initialized variables can be placed into program memory area
SimpleWebServer:72: error: no match for 'operator<<' in 'Serial << (const __FlashStringHelper*)({...})'
SimpleWebServer.ino:76: warning: only initialized variables can be placed into program memory area
SimpleWebServer:76: error: no match for 'operator<<' in 'Serial << (const __FlashStringHelper*)({...})'
SimpleWebServer.ino:79: warning: only initialized variables can be placed into program memory area
SimpleWebServer:79: error: no match for 'operator<<' in 'Serial << (const __FlashStringHelper*)({...})'

Are there any Libraries I can use? Is there "ONE" library everyone uses for those Webservers (using SD-Card for switching pins or sth.)?

14  Using Arduino / Microcontrollers / Re: ATmega2560 custom board problem on: March 30, 2013, 07:41:35 am
The best way for me was to use the sketch from Gammon. Give it a try smiley

http://www.gammon.com.au/forum/?id=11635

Thanks, I'll try that later. Is that a sketch that you put on one adruino board to program a bootloader to another board? Specifically made for ATMega2560 it looks like?

Cheers

Well, its an "all in one" sketch. You can upload it to your mega and connect your mega proto to it. It recognizes it and chooses the proper boot loader.

If you get verification errors while using this sketch change the clockdivider to the following

Code:
 // slow down SPI for benefit of slower processors like the Attiny
  SPI.setClockDivider (SPI_CLOCK_DIV64);

to

Code:
 // slow down SPI for benefit of slower processors like the Attiny
  SPI.setClockDivider (SPI_CLOCK_DIV128);


15  Using Arduino / Microcontrollers / Re: ATmega2560 custom board problem on: March 30, 2013, 05:35:46 am
The best way for me was to use the sketch from Gammon. Give it a try smiley

http://www.gammon.com.au/forum/?id=11635



Pages: [1] 2 3 ... 7