Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Put serial input string on an LCD screen on: January 26, 2013, 12:39:24 pm
This is my current program:
Code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
char prevValue;

void setup() {
  Serial.begin(9600);
    lcd.begin(16, 2);
    lcd.setCursor(0,0);
}

void loop() {
  if (Serial.available() > 0) {
    char value = Serial.read();
    if (prevValue != value){
      lcd.clear();
      prevValue = value;
    }
    Serial.println(prevValue);
    lcd.print(prevValue);
  }
}

When you type in any char in the serial monitor, it will print it on my LCD screen.
Now I want to make it read an entire string.  Also, the part of my program that listens for a new char to change the screen will not work if the inputted char is the same as the previous one. Any suggestions/help?
2  Using Arduino / Programming Questions / Re: Keep variable value until serial input is changed on: January 26, 2013, 12:23:49 pm
Okay, I realized No Line Ending does it.
3  Using Arduino / Programming Questions / Re: Keep variable value until serial input is changed on: January 07, 2013, 04:36:31 pm
Like selecting an option that does not add an extra character or 2

Can you please explain in detail?
4  Using Arduino / Programming Questions / Re: Keep variable value until serial input is changed on: January 06, 2013, 05:20:48 pm
There are other options...

Like...
5  Using Arduino / Programming Questions / Re: Keep variable value until serial input is changed on: January 06, 2013, 02:02:53 pm
It's a hint for you to tell us what is sending the serial data to the Arduino, and how. If you are using the Serial Monitor, what option have you selected (at the bottom)?

'Carriage Return' is selected
6  Using Arduino / Programming Questions / Re: Keep variable value until serial input is changed on: January 06, 2013, 01:50:01 pm
Quote
However, the LED turns off on its own since the serial monitor returns to a default value immediately.
More likely, you're sending carriage-return/line-feed.


Is this an answer?
7  Using Arduino / Programming Questions / Keep variable value until serial input is changed on: January 06, 2013, 12:34:23 pm
I found this code from http://www.suffix.be/blog/send-data-to-arduino

Code:
int ledPin = 13;

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  if (Serial.available() > 0) {
    char value = Serial.read();
    if (value == '1') {
      digitalWrite(ledPin, HIGH);
    } else {
      digitalWrite(ledPin, LOW);
    }
    Serial.println(value);
  }
  delay(1000);
}

It turns on the onboard LED when you type '1' in the serial monitor, and off when you type anything else.

However, the LED turns off on its own since the serial monitor returns to a default value immediately.

Does anybody know a way to make the LED stay on until you type something else in?
8  Community / Exhibition / Gallery / Re: Bitlash Commander: Web UI toolkit for Arduino on: January 06, 2013, 12:29:15 pm
How hard is it to come up with my own web interface?
9  Community / Exhibition / Gallery / Re: Bitlash Commander: Web UI toolkit for Arduino on: December 31, 2012, 03:23:01 pm
Still doesn't work.... same error. Thanks for your help by the way.
10  Community / Exhibition / Gallery / Re: Bitlash Commander: Web UI toolkit for Arduino on: December 30, 2012, 09:13:17 pm
I did cd bitlash-commander, node index.js, and now got this:
Code:
/Users/Max/bitlash-commander/node_modules/serialport/node_modules/bindings/bindings.js:85
  throw err
        ^
Error: Could not load the bindings file. Tried:
 -> /Users/Max/bitlash-commander/node_modules/serialport/build/Debug/serialport.node
 -> /Users/Max/bitlash-commander/node_modules/serialport/build/Release/serialport.node
 -> /Users/Max/bitlash-commander/node_modules/serialport/out/Debug/serialport.node
 -> /Users/Max/bitlash-commander/node_modules/serialport/Debug/serialport.node
 -> /Users/Max/bitlash-commander/node_modules/serialport/out/Release/serialport.node
 -> /Users/Max/bitlash-commander/node_modules/serialport/Release/serialport.node
 -> /Users/Max/bitlash-commander/node_modules/serialport/build/default/serialport.node
 -> /Users/Max/bitlash-commander/node_modules/serialport/compiled/0.8/darwin/x64/serialport.node
    at bindings (/Users/Max/bitlash-commander/node_modules/serialport/node_modules/bindings/bindings.js:82:13)
    at Object.<anonymous> (/Users/Max/bitlash-commander/node_modules/serialport/serialport.js:7:44)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/Users/Max/bitlash-commander/lib/bitlash.js:6:18)
    at Module._compile (module.js:449:26)
11  Community / Exhibition / Gallery / Re: Bitlash Commander: Web UI toolkit for Arduino on: December 29, 2012, 07:44:54 pm
Sorry, noob here.
In the Install tutorial, i was at the
Code:
npm install
command when it just stopped doing requests. I opened another terminal window, did the
Code:
node index.js
command and I get this error:
Code:
module.js:340
    throw err;
          ^
Error: Cannot find module '/Users/Max/index.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.runMain (module.js:492:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

Any help?
12  Using Arduino / Project Guidance / Re: Access a 'status' page in the browser? on: December 29, 2012, 07:37:38 pm
I got pretty far in, but after I got a ton of nodeJS-related errors I decided it wasn't worth it.

Are there any alternatives?
13  Using Arduino / Project Guidance / Re: Access a 'status' page in the browser? on: December 29, 2012, 07:09:00 pm
Thanks, I'll try it out.
14  Using Arduino / Project Guidance / Access a 'status' page in the browser? on: December 29, 2012, 06:57:41 pm
Basically I want to be able to plug the arduino in via usb and be able to use it as a web server. The arduino would be able to modify the files on the web server so for example I could have a 'status' page that I access with my web browser.

Is there a way to do this without ethernet or with WiFi instead? If so, I'm not exactly sure how to do this.
Pages: [1]