Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Assignment due tomorrow, thought it was an easy fix.... on: October 29, 2013, 11:02:41 am
Hey guys!

I'm far from an experienced Arduino guy but sometimes it can come in handy with what I do. I got an Assignment due in like 4h and I've been trying to figure out why this is not working.
Short info about the assignment, it's a machine that got a "lift" which have a bottom switch and a top switch. When the bottom switch is switched on (momentarily), a variable says "run lift" until it hits the top. Very simple but I have no idea what I'm doing wrong.
Here is the code that I've been working with, not surprised if there is heaps of misstakes in general but hey, i just want it to run.

(The motors are connected to a transistor etc. but that should be fine)

Belt part at the end is just another part of the machine.... It needs to run for like 2sec.

Would appreciate help a lot  smiley-cry

EDIT: The problem I mainly had was to change the state of liftState. It is always 1, or HIGH of some reason....
const int liftBottom = 5;
const int liftTop = 6;
const int beltSw = 7;
const int lift = 10;
const int belt = 9;

int liftState = LOW;
int val = 0;
int valTop = 0;
int valBelt = 0;
int valLift = 0;
int tempTest = 0;

void setup() {
  pinMode(liftBottom, INPUT);
  pinMode(liftTop, INPUT);
  pinMode(beltSw, INPUT);
  pinMode(lift, OUTPUT);
  pinMode(belt, OUTPUT);

void loop() {
 tempTest = digitalRead(liftState);
    val = digitalRead(liftBottom);
    valTop = digitalRead(liftTop);
////___________Check the state of the lift______
if (val == HIGH) {
//   digitalWrite(liftState, HIGH);
analogWrite(lift, 255);
   else if (valTop == HIGH){
//    digitalWrite(liftState, LOW);
analogWrite(lift, 0);

   ///__________________________LIFT CONTROLLER
   valLift = digitalRead(liftState);

   if (valLift == HIGH) {
    analogWrite(lift, 255);
     analogWrite(lift, 0);
   valBelt = digitalRead(beltSw);
   if (valBelt == HIGH) {
     analogWrite(belt, 255);
      analogWrite(belt, 0);

2  Using Arduino / Sensors / Re: Sensor information hunting on: October 14, 2013, 10:18:20 pm
I found this underneth the cables...

What company is that, Anyone knows?
3  Using Arduino / Sensors / Sensor information hunting on: October 14, 2013, 09:26:34 pm
Hey guys!

I pulled this optical rotary sensor from a Canon pixma MP230 printer and I've been searching for a datasheet for it but I can't find any info at all. It's for the "feeing" mechanism of papers which I'm assuming determine what "row" it prints...

I'll post some pictures, hoping someone here is better than me of google'ing smiley

The text on the sensor it self says: K 36-2613 (the K is twice the size to the numbers)
On the circuit board it self it says: QM7-2653
new row: QK18762
new row: 01

All help much appreciated. Maybe there is similar ones out there so I can guess a bit maybe...
4  Using Arduino / LEDs and Multiplexing / Re: Arduino controlling an Philips MR16, dimming.... on: October 10, 2013, 06:58:55 pm
Interesting... Though the one I'm planing to buy, I'm pretty sure that one didn't have any fan in it. Maybe this only occurs on really high powered ones?

How about if I already have a driver? Do I still need a MOSFET or simliar? Thought(hoping) I wouldn't... smiley
5  Using Arduino / LEDs and Multiplexing / Arduino controlling an Philips MR16, dimming.... on: October 10, 2013, 03:40:33 am
Hey guys!

I'm fairly new in the Arduino world but I just wanna run this through more experienced people (you guys smiley-razz)

I'm working on a lamp and I want it to have a bit of "intelligence". Depending on how you turn the knob it acts differently etc.

It's a 12V LED (Philips MR16 10w).  The code it self I can figure out I think but with the electronics is a bit more of a confusion.

The controlling part is an encoder disc from a printer but I'm unsure about the output.  What should I get? I have a driver with the right output but the controlling as a "limiting" the light.

Anyway, it should be fairly simple but, I would love some guidance here smiley
6  International / Scandinavia / Re: Hello world! (of Arduino). Svensk i Australien on: July 17, 2012, 04:40:51 am
Tack å bock! smiley

Jao, det är nog just inget fel på min Engelska... Nästan svårare att prata Svenska haha. Har bara varit här i drygt 1.5år men planerar att vara här mycket längre då mina studier är 3 år till iaf.

Vi får se till att liva upp Scandinavia delen då smiley-grin

Vad har ni får projekt på gång i detta nu? smiley
7  International / Scandinavia / Hello world! (of Arduino). Svensk i Australien on: July 17, 2012, 02:09:56 am
Jag tänkte bara säga hej till alla skandenaver här i forumet och presentera mig själv!

Jag är Svensk men bor i Australien, Melbourne. Har elektronik och spelutvecklingsbakgrund men pluggar nu design. Kommer att ha användning av Arduinon i många design projekt gissar jag så det är väl lika bra att lära sig använda den smiley-wink

Har just beställt ett startkit med en Uno, breadboard lite kablar osv från Ebay.

Hur som helst, hoppas det är full fart på detta forumet för jag har en känsla av att jag kommer vara här rätt mycket hehe :-D
Pages: [1]