Show Posts
Pages: [1] 2 3
1  Using Arduino / Project Guidance / Digit display on: August 08, 2013, 09:47:07 am
I have an Arduino uno running a program to detect the value from several sensors and relay the final numerical result to the serial port. I would like for this number to be displayed on a large dual digit seven segment or LED matrix that could be easily viewed by a forklift driver. does anyone have any good recomendations as to where i could purchase such display with 8" tall or larger digits? Also, how would the display recieve the data to display?
Thanks
2  Using Arduino / Programming Questions / Reading a sensor for a short time on: March 25, 2013, 07:33:05 pm
I have a photocell reading light level. When the sensor goes below threshold I want to read what it is collecting for the next 500 milliseconds then disregard any readings after that. What would be the best way to do this?
3  Using Arduino / Programming Questions / Re: Ethernet to iOS problems on: March 18, 2013, 04:15:29 pm
also here are the error codes I have






FarmCount:25: error: expected constructor, destructor, or type conversion before 'void'
FarmCount:81: error: expected unqualified-id before '.' token
FarmCount.ino: In function 'void loop()':
FarmCount:171: error: 'iosController' was not declared in this scope
FarmCount.ino: In function 'void doWork()':
FarmCount:265: error: a function-definition is not allowed here before '{' token
FarmCount:280: error: a function-definition is not allowed here before '{' token
FarmCount:291: error: a function-definition is not allowed here before '{' token
4  Using Arduino / Programming Questions / Ethernet to iOS problems on: March 18, 2013, 04:11:58 pm
This code should be sending data to the iphone app Arduino Manager but will not compile, suggestions?

Code:
#include <SPI.h>
#include <Ethernet.h>
#include <SD.h>
#include <Servo.h>
#include <IOSController.h>
#include <avr/wdt.h>

int Trigger = 600; // value photocell reading must be below to trigger "break"
int CumulativeTotal = -3; //initial value of CumulativeTotal = -3 to account for first "test read" on all sensors

const int LEDpinlowred = 9;//Red LED 1
const int LEDpinmidred = 11; //Red LED 2
const int LEDpintopred = 12;//Red LED 3
const int LEDpinStat = 13;
const int laserPin = 5; //Variable power transmitter


/*
 *
 * Ethernet Library configuration
 *
 */
byte mac[] = {
  0x90, 0xA2, 0xDA, 0x00, 0xC5, 0x79 };  // MAC Address assigned to the board

/*
*
 * IP info
 *
 * Using DHCP these parameters are not needed
 */
IPAddress ip(192,168,1,220);
IPAddress gateway(192,168,1,220);
IPAddress subnet(255,255,255,0);

/*
 *
 * Initialize the Ethernet server library
 */
EthernetServer server(80);   // Messages received on port 80

#define CHIPSELECT 4;


/*
 *
 * Prototypes of IOSController’s callbacks
 *
 *
 */


void doWork();
void doSync(char *variable);
void processIncomingMessages(char *variable, char *value);
void processOutgoingMessages();
void deviceConnected();
void deviceDisconnected();

/*
 *
 * IOSController Library initialization
 *
 */

begin.IOSController
void setup()
{
  Serial.begin(115200);

 
   
  pinMode(10, OUTPUT);     // change this to 53 on a mega
  digitalWrite(10, HIGH);  // but turn off the W5100 chip!



 
  Ethernet.begin(mac, ip, subnet, gateway); 

  server.begin();




  pinMode(A0, INPUT); //Low Photocell
  pinMode(A1, INPUT); //Middle Photocell
  pinMode(A2, INPUT); //High Photocell
  pinMode(2, OUTPUT); //Seven Segment Display 'a'
  pinMode(3, OUTPUT); //Seven Segment Display 'b'
  pinMode(4, OUTPUT); //Seven Segment Display 'c'
  pinMode(5, OUTPUT); //Seven Segment Display 'd'
  pinMode(6, OUTPUT); //Seven Segment Display 'e'
  pinMode(7, OUTPUT); //Seven Segment Display 'f'
  pinMode(8, OUTPUT); //Seven Segment Display 'g'                                                ------------------
  pinMode(9, OUTPUT); //Seven Segment Display 'h'                                               |   /0/1/2/    3    |
  pinMode(LEDpinlowred, OUTPUT); //User interface panel LED 0(Red)  diagonostics A2             |                   }
  pinMode(LEDpinmidred, OUTPUT); //User interface panel LED 1(Red)  diagonostics A1             |                 4 |
  pinMode(LEDpintopred, OUTPUT); //User interface panel LED 2(Red)  diognostics A0                ------------------
  pinMode(LEDpinStat, OUTPUT); //User interface panel LED 3(amber) systems status indicator(blink = uploading serial data)(solid = problem)
  pinMode(laserPin, OUTPUT); //Powers laser transmission pole

  digitalWrite (LEDpinlowred, 0);
  delay(350);
  digitalWrite (LEDpinlowred, 1);
  delay(350);
  digitalWrite (LEDpinmidred, 0);
  delay(350);
  digitalWrite (LEDpinmidred, 1);
  delay(350);
  digitalWrite (LEDpintopred, 0);
  delay(350);
  digitalWrite (LEDpintopred, 1);
  delay(750);
  digitalWrite (LEDpintopred, 0);
  delay(350);
  digitalWrite (LEDpintopred, 1);
  delay(150);
  digitalWrite (LEDpinmidred, 0);
  delay(150);
  digitalWrite (LEDpinmidred, 1);
  delay(150);
  digitalWrite (LEDpinlowred, 0);
  delay(150);
  digitalWrite (LEDpintopred, 1);

  delay(500);
  digitalWrite (LEDpinlowred,0);
  digitalWrite (LEDpinmidred,0);
  digitalWrite (LEDpintopred,0);
  delay(400);
  digitalWrite (LEDpinlowred,1);
  digitalWrite (LEDpinmidred,1);
  digitalWrite (LEDpintopred,1);
  delay(400);
  digitalWrite (LEDpinlowred,0);
  digitalWrite (LEDpinmidred,0);
  digitalWrite (LEDpintopred,0);
  delay(400);
  digitalWrite (LEDpinlowred,1);
  digitalWrite (LEDpinmidred,1);
  digitalWrite (LEDpintopred,1);
  delay(400);
  digitalWrite (LEDpinlowred,0);
  digitalWrite (LEDpinmidred,0);
  digitalWrite (LEDpintopred,0);
  delay(400);
  digitalWrite (LEDpinlowred,1);
  digitalWrite (LEDpinmidred,1);
  digitalWrite (LEDpintopred,1);
}

void loop()
{
  //iosController.loop();
  iosController.loop(500);
}
void doWork() {

  delay (1200); // Most useful for tuning, sensor read time
  if  (analogRead(2) > Trigger){
    (++CumulativeTotal);
  } // if condition is true add 1 to 'The cumulative total' which will be displayed to the seven segment display.
  else // do nothing
  if (analogRead(2) < 600) {
    digitalWrite (LEDpintopred, 1);
  }
  if (analogRead(2) > 600) {
    digitalWrite (LEDpintopred, 0);
  }
  delay(1);


  if  (analogRead(1) > Trigger)  {
    (++CumulativeTotal);
  }  // if condition is true add 1 to 'The cumulative total' which will be displayed to the seven segment display.
  else// do nothing
  if (analogRead(1) < Trigger) {
    digitalWrite (LEDpinmidred, 1);
  }
  if (analogRead(1) > Trigger) {
    digitalWrite (LEDpinmidred, 0);
  }
  delay(1);

  if  (analogRead(0) > Trigger)  {
    (++CumulativeTotal);
  }// if condition is true add 1 to 'The cumulative total' which will be displayed to the seven segment display.
  else// do nothing
  if (analogRead(0) < Trigger) {
    digitalWrite (LEDpinlowred, 1);
  }
  if (analogRead(0) > Trigger) {
    digitalWrite (LEDpinlowred, 0);
  }


  delay(10);
  if (analogRead(0) > Trigger) {
    delay(10000);
  }
  if (CumulativeTotal > 20){
    digitalWrite (LEDpinStat, 1);
  }



  {
    Serial.println ("Total Product Loaded:-");
    Serial.println (CumulativeTotal);
  }
  if (Serial.available()) {

    //read serial as a character
    char ser = Serial.read();

    switch (ser) {
    case '1':
      analogWrite(laserPin, 50);
      break;
    case '2':
      analogWrite(laserPin, 100);
      break;
    case '3':
      analogWrite(laserPin, 150);
      break;
    case '4':
      analogWrite(laserPin, 200);
      break;
    case '5':
      analogWrite(laserPin, 250);
      break;
    case '0':
      analogWrite(laserPin, 0);
      break;
    case 'c':
      (CumulativeTotal = 0);
      break;
    case '+':
      (++CumulativeTotal);
      break;
    case '-':
      (--CumulativeTotal);
      break;
    case 'ul58':
      (CumulativeTotal = -58);
      break;
    }
  }
  void processOutgoingMessages() {



    iosController.writeMessage("Total",CumulativeTotal);


  }

  /**
   *
   *
   * This function is called when the iOS device connects
   *
   */
  void deviceConnected () {

    digitalWrite(CONNECTIONPIN,HIGH);
  }

  /**
   *
   *
   * This function is called when the iOS device disconnects
   *
   */
  void deviceDisconnected () {

    digitalWrite(CONNECTIONPIN,LOW);
  }

}


There is alot of useless code there so let me trim it up. I think the problem is here somewhere
Code:
#include <IOSController.h>
#include <avr/wdt.h>

int Trigger = 600; // value photocell reading must be below to trigger "break"
int CumulativeTotal = -3; //initial value of CumulativeTotal = -3 to account for first "test read" on all sensors

const int LEDpinlowred = 9;//Red LED 1
const int LEDpinmidred = 11; //Red LED 2
const int LEDpintopred = 12;//Red LED 3
const int LEDpinStat = 13;
const int laserPin = 5; //Variable power transmitter


/*
 *
 * Ethernet Library configuration
 *
 */
byte mac[] = {
  0x90, 0xA2, 0xDA, 0x00, 0xC5, 0x79 };  // MAC Address assigned to the board

/*
*
 * IP info
 *
 * Using DHCP these parameters are not needed
 */
IPAddress ip(192,168,1,220);
IPAddress gateway(192,168,1,220);
IPAddress subnet(255,255,255,0);

/*
 *
 * Initialize the Ethernet server library
 */
EthernetServer server(80);   // Messages received on port 80

#define CHIPSELECT 4;


/*
 *
 * Prototypes of IOSController’s callbacks
 *
 *
 */


void doWork();
void doSync(char *variable);
void processIncomingMessages(char *variable, char *value);
void processOutgoingMessages();
void deviceConnected();
void deviceDisconnected();

/*
 *
 * IOSController Library initialization
 *
 */

begin.IOSController
void setup()
{
  Serial.begin(115200);

 
   
  pinMode(10, OUTPUT);     // change this to 53 on a mega
  digitalWrite(10, HIGH);  // but turn off the W5100 chip!



 
  Ethernet.begin(mac, ip, subnet, gateway); 

  server.begin();
or maybe here
Code:
void loop()
{
  //iosController.loop();
  iosController.loop(500);
}
void doWork() {
or maybe here
Code:
void processOutgoingMessages() {



    iosController.writeMessage("Total",CumulativeTotal);


  }

  /**
   *
   *
   * This function is called when the iOS device connects
   *
   */
  void deviceConnected () {

    digitalWrite(CONNECTIONPIN,HIGH);
  }

  /**
   *
   *
   * This function is called when the iOS device disconnects
   *
   */
  void deviceDisconnected () {

    digitalWrite(CONNECTIONPIN,LOW);
  }

}




Be easy on on me I am a complete newbie on ethernet and not exactly a pro with arduino and libraries
Thanks in advance
5  Using Arduino / Programming Questions / Re: arduino manager app on: March 18, 2013, 01:37:18 pm
Heres where I'm at. I have an arduino uno with the arduino ethernet shield. the ethernet sheild is conneted to a netgear router i have the arduino ethernet library imported and the isocontroller library as well. I have the app downloaded on my iphone 5 but cannot connect the two. My question is where do i go from here? I want to add the functions to send and recieve data from the iphone to my existing code. I want to display the value of "cumulativeTotal" to a display widget and have the reset pin controled by a pushbutton widget. the problem is somewhere in the ip/mac adress part of the code. I dont know what these should be set as. help please?
6  Using Arduino / Programming Questions / Re: arduino manager app on: March 17, 2013, 09:22:07 pm
yes I downloaded the pdf and it was very uninformative.
7  Using Arduino / Programming Questions / arduino manager app on: March 17, 2013, 08:47:34 pm
I downloaded arduino manager app on an iphone 5 but am completly lost on the programming side. I want to send a value named "total" to a display widget on the iPhone. Anybody here have any experience with the app?
8  Using Arduino / Project Guidance / Re: serial data logging on: March 17, 2013, 07:56:20 pm
what should i add into my arduino code to send the data to TrySerial?
9  Using Arduino / Programming Questions / Re: code review on: March 14, 2013, 05:46:32 pm
Analog inputs 0,1,2 are sensors at different heights, sorry about the blank spaces, helps me organize thought, Ideally I want to have a timer start when the lowest (A0) is below a threshold. When the timer reaches 500 mills disregard all readings for the next 3000 mills. I feel like i'm really close it just wont work. smiley-confuse
10  Using Arduino / Project Guidance / Re: serial data logging on: March 14, 2013, 05:35:28 pm
I downloaded processing but i'm such a rookie at this it's not even in my relm of feasability to make an application. anywhere i could find one already made?
11  Using Arduino / Programming Questions / code review on: March 14, 2013, 05:32:56 pm
help me slim this piece up a touch, i know theres got to be easier ways to do this
Code:
void loop()
{
  delay (12); //1200 Most useful for tuning, sensor read time

  if  (analogRead(0) < Trigger){
    sensorstate = LOW;}
    else {sensorstate = HIGH;}
 
 

 
  if (sensorstate = LOW)  {unsigned long currentmillis = millis();}
 







while (currentMillis - previousMillis < readtime)
  { 
    if  (analogRead(0) < Trigger){
      (++ForkLoad);
    } // if condition is true add 1 to 'The cumulative total' which will be displayed to the seven segment display.
    else // do nothing
    if (analogRead(0) > 100) {
      digitalWrite (LEDpinlowred, 1);
    }
    if (analogRead(0) < 100) {
      digitalWrite (LEDpinlowred, 0);
    }

    delay(1);


    if  (analogRead(1) < Trigger)  {
      (++ForkLoad);
    }  // if condition is true add 1 to 'The cumulative total' which will be displayed to the seven segment display.
    else// do nothing
    if (analogRead(1) > Trigger) {
      digitalWrite (LEDpinmidred, 1);
    }
    if (analogRead(1) < Trigger) {
      digitalWrite (LEDpinmidred, 0);
    }
    delay(1);

    if  (analogRead(2) < Trigger)  {
      (++ForkLoad);
    }// if condition is true add 1 to 'The cumulative total' which will be displayed to the seven segment display.
    else// do nothing
    if (analogRead(2) > Trigger) {
      digitalWrite (LEDpintopred, 1);
    }
    if (analogRead(2) < Trigger) {
      digitalWrite (LEDpintopred, 0);
    }

   

  }
 
 
 
   if(currentMillis - previousMillis < readtime) {
         
        previousMillis = currentMillis;
   


if (sensorstate = LOW){
    delay(3000);
  }


12  Using Arduino / Project Guidance / serial data logging on: March 14, 2013, 03:12:33 pm
I have several values being printed to the arduino IDE serial monitor using the println function. I would like to use some other program or application to display this data in a more organized fashion. What are some options other than labview or arduino manager?
13  Using Arduino / Displays / shift register to 7 segment on: February 27, 2013, 10:36:08 pm
say I want to use 3 output pins from my arduino (clock,data,latch) to drive 2 shift resisters to 2 standard radioshack 7 segment displays. i have an int value i want displayed on the displays. point me in the right direction.
14  Using Arduino / Displays / 74hc595 shift register discrepancy on: February 19, 2013, 11:12:35 pm
there are several different pinouts on online datasheets for the 74hc595 shift register is anyone sure of a CORRECT one?
15  Using Arduino / Programming Questions / Analog input timer on: October 15, 2012, 04:42:15 pm
small issue I know one of you can helo me out with very easily. If I want the code below to only work if the analogRead has been less than two for 30 seconds what do i do?
Code:
if (analogRead(0) < 2) {digitalWrite (LEDpinStat, HIGH);}
Pages: [1] 2 3