Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / Microcontrollers / Re: PWM Controller on: June 11, 2014, 12:38:46 am
where is "AnalogWrite()" in your code?
2  Development / Other Software Development / Re: ******* Creating First Library.. PROBLEMSSSSS!! as expected... on: May 26, 2014, 01:45:27 am
You can make lib like attached code and I think no need to make class because this is a simple task. I did not tested code, you will take care of if any problem on code.

Code:
byte colPins[4] = { 0,1,2,3 };
byte segPins[7] = { 4,5,6,7,8,9,12 };

byte seg7digits[10][7] = { { 1,1,1,1,1,1,0 },  // = 0
                           { 0,1,1,0,0,0,0 },  // = 1
                           { 1,1,0,1,1,0,1 },  // = 2
                           { 1,1,1,1,0,0,1 },  // = 3
                           { 0,1,1,0,0,1,1 },  // = 4
                           { 1,0,1,1,0,1,1 },  // = 5
                           { 1,0,1,1,1,1,1 },  // = 6
                           { 1,1,1,0,0,0,0 },  // = 7
                           { 1,1,1,1,1,1,1 },  // = 8
                           { 1,1,1,0,0,1,1 }   // = 9
                           };

// Setup
void Seg7Init() {
  //
  for (byte i = 0; i < 4; ++i) {
    pinMode(colPins[i], OUTPUT);   
  }
  //
  for (byte i = 0; i < 7; ++i) {
     pinMode(segPins[i], OUTPUT);   
  } 
}

// write digit to given address   
void Seg7Write(byte col, byte digit) { 
  for (byte i = 0; i < 7; ++i) {   
     digitalWrite(segPins[i], seg7digits[digit][i]);   
  }
 
  digitalWrite(colPins[col], LOW);
}

//Blank the digit
void Seg7Off(byte col) {   
  digitalWrite(colPins[col], HIGH); 
}

//Blank all digits
void Seg7AllOff() {
  //
  for (byte i = 0; i < 4; ++i) {
    Seg7Off(i);
  }

3  Using Arduino / Displays / Re: Arduino i2c for 16x2 lcd no backlight or text after upload on: May 22, 2014, 02:50:22 pm
Adjust the contrast with a screw on blue trimmer.
4  Using Arduino / Displays / Re: Arduino i2c for 16x2 lcd no backlight or text after upload on: May 22, 2014, 02:19:29 pm
Device address is 0x20 not 0x27.  You should solder the A0, A1 and A2 joints for 0x27.
5  Development / Other Hardware Development / Re: Arduino Without FTDI chip using V-USB (Virtual USB) on: November 12, 2012, 05:36:56 am
Rashed,

As decsribed in Metalab site "AVR's UART lines are not used for USB. This means that they can be used for other purposes, but also that debug output written to the UART cannot be directly received via USB."

Unfortunately Metaboard doesn't support Serial communitication via USB.
6  Using Arduino / Programming Questions / Re: Connecting two ardunio boards using an RF link on: November 18, 2011, 05:27:04 am
Module seems to same as RF12B. Try Jeenode RF12 libraries.
7  Using Arduino / Programming Questions / Re: long press button on: November 04, 2011, 05:36:43 am
Jeff has a nice code for button click, double click, hold & long hold. Please look it http://jmsarduino.blogspot.com/2009/10/4-way-button-click-double-click-hold.html
8  Using Arduino / Programming Questions / Re: problem using the map() function.. on: October 18, 2011, 03:40:25 am
Your map range is 0 to 3. But you are expecting values in range 1 to 4.

Quote
waveSelect = map(pot1, 0, 1023, 0, 3);      //waveform pot, divided into 4 
9  Using Arduino / Programming Questions / Re: Manage ports? on: September 19, 2011, 03:08:10 am
@WizenedEE

Yes you are right, direct hardware usage is always faster than prototype functions.  But most of Arduino users including me have not electronic background. For us really hard to understand MCU hardware basics. And the aim of Arduino platform is to make the usage of microcontroller easier to everyone. IMO with these port functions every Arduino user can easily use the ports.
10  Using Arduino / Programming Questions / Re: Manage ports? on: September 19, 2011, 12:27:26 am
Sorry my fault you also have to put function prototypes in "Arduino.h".
Function prototypes are;
Code:
void portMode(uint8_t port, uint8_t mode);
uint8_t portRead(uint8_t port);
void portWrite(uint8_t port, uint8_t val);
11  Using Arduino / Programming Questions / Re: Manage ports? on: September 18, 2011, 02:48:36 pm
As I mentioned I saw these functions in Wiring source. After testing them I put them in wiring_digital.c to make them built-in.

They works well in regular code also.  But you should add "false" after return of statement "if (inputregister == NOT_A_PORT) return;"
in portRead function.
12  Using Arduino / Displays / Re: Can I make more than 8 own characters in 16x2 LCD display on: September 18, 2011, 10:41:53 am
Do you need all 8 characters at a time? Only trick is you can discard unused ones and create new.
13  Using Arduino / Programming Questions / Re: Manage ports? on: September 18, 2011, 02:02:26 am
I have mooched the port manipulation functions from wiring platform. Copy them into "wiring_digital.c" to have built-in port manipulation.

Functions
Code:
void portMode(uint8_t port, uint8_t mode)
{
volatile uint8_t *moderegister;

moderegister = portModeRegister(port);

if (moderegister == NOT_A_PORT) return;

uint8_t oldSREG = SREG;
cli();

//*moderegister = mode;
if (mode == OUTPUT)
*moderegister = 0xff;
else
*moderegister = 0x00;

SREG = oldSREG;
}

uint8_t portRead(uint8_t port)
{
volatile uint8_t *inputregister;

inputregister = portInputRegister(port);

if (inputregister == NOT_A_PORT) return;

uint8_t oldSREG = SREG;
cli();
uint8_t portValue = *inputregister;
SREG = oldSREG;
return portValue;
}

void portWrite(uint8_t port, uint8_t val)
{
volatile uint8_t *portregister;

portregister = portOutputRegister(port);

if (portregister == NOT_A_PORT) return;

uint8_t oldSREG = SREG;
cli();
*portregister = val;
SREG = oldSREG;
}

Example
Code:
void setup() {
  portMode(PD, OUTPUT);
}

void loop() {
  portWrite(PD, B0001000);
  delay(500);
  portWrite(PD, B0000000);
  delay(500);
}
14  Using Arduino / Displays / Re: DIP204-4 with SPI on: September 14, 2011, 12:28:30 am
According to datasheet I could not see "Display on" command on your sketch.
15  Development / Other Hardware Development / Re: ATMEL Mega1284P evaluation board avalible on: September 11, 2011, 07:22:45 am
The link is http://code.google.com/p/brewtroller/downloads/detail?name=Sanguino1284P.zip&can=2&q= which I have downloaded.
Pages: [1] 2 3 ... 6