Recent Posts

Pages: [1] 2 3 ... 10
Show us how you are sending it.
And, tell us what is sending the data. If what is sending the data is sending text, you have no choice but to read the data AS TEXT.
I made some changes based on what I interpreted the recognized problems in scanKeys(). This is one such change:

Code: [Select]
for (int i = 0; i < 6; i++) // Turn pins 12-17 high (inactive) -- should be 18 once function keys in place
    digitalWrite(i + 8, LOW); // Turn low

We are using an Arduino Uno, Sparkfun variation. The original code that we started with was built for a Nano. We're trying to manipulate it to work on an Uno.
Programming Questions / Re: Touch Activated Servo
Last post by PaulS - Today at 01:13 am
Code: [Select]
      angle == 180;
That is NOT the assignment operator.
Programming Questions / Re: Definitions and Void Setup
Last post by PaulS - Today at 01:09 am
Take a look at your Arduino. Do you SEE a slider? Mine didn't come with one. Do you SEE a BLE? Mine didn't come with one. When you add external hardware, you should get a library that goes with the hardware. If not, that's NOT the hardware for you. Libraries come with examples.
I'm in the middle of a school project and am running into some issues. I'm trying to use an Arduino to sense the voltage spike from a Hall Effect sensor that is in close contact with a spinning "pick up" wheel that we had cut out from a water jet table. The pickup wheel goes onto a spinning shaft extruding from the differential of our buggy. Over the weekend we took the sensor into the lab and simulated our spinning wheel and used an oscilloscope to look at the signal and a multi-meter to test max voltage generated. The max voltage we got was .33 DCV. We found a code online for Arduino that hopefully I can post below and simply had us put one wire from the sensor into an analog input on the uno and the other wire from the sensor to ground on the uno. We opened up the serial monitor and watched the program and uno sense voltage.

My questions are, we had no time reference so is there a way to have the time posted beside the voltage value in the serial monitor window? Also, what is the base line sensing time that the uno is set to and how to I change it to the shortest time increments as possible. Thirdly, is there a way to set the uno up to just sense an incoming voltage when a signal is presented to the uno? I would prefer that was so if the buggy becomes stationary for a couple of minutes, the uno is not filling up pages and pages of zeros.

I honestly do not know how to write code so this has been very frustrating. The group is talking about using a raspi in conjunction with the uno but that is down the road. Thanks for the help

Robotics / Using IR Receiver to control r...
Last post by Relic - Today at 01:07 am
Right now I'm just testing that the arduino and IR receiver are outputting the correct info before testing it completely out with the motor controller and motors.

Currently, pressing up, down, and enter on the remote have the desired effect of increasing, decreasing, and resetting the speed of the motor. However, when I press left or right it has the same effect as enter in that s and i remain the same and the speeds of the left and right motor are 0.

I didn't bother including a circuit as I am receiving the IR code for the left and right buttons in the serial monitor, it just doesn't increment/decrement i. Any ideas as to why this would be the case?


I am open to any suggestions/corrections/etc.

Code: [Select]
#include <IRremote.h>

//Right motor
const int enablepinA = 3;
const int drivepin1 = 2;
const int drivepin2 = 4;

//Left motor
const int enablepinB = 5;
const int drivepin3 = 6;
const int drivepin4 = 7;

const int RECV_PIN = 8;
IRrecv irrecv(RECV_PIN);
decode_results results;
unsigned long key_value = 0;

int speed[] = {240, 180, 120, 0, 120, 180, 240}; //PMW values up to 255
int s = 3; //index for speed vector
byte d = 00000101; // index of high and low for driver pins

int turn[] = {240, 180, 0, 180, 240}; // PMW values up to 255
int i = 2;  //index for turning direction
int right = 0;
int left = 0;

void setup() {
   /* pinMode(enablepinA, OUTPUT);
    pinMode(drivepin1, OUTPUT);
    pinMode(drivepin2, OUTPUT);
    pinMode(enablepinB, OUTPUT);
    pinMode(drivepin3, OUTPUT);
    pinMode(drivepin4, OUTPUT);*/

void loop() {
  //direction 1

  if (irrecv.decode(&results)){
    if (results.value == 0xFFFFFFFF)
      results.value = key_value;
    switch(results.value) {
      case 0x9EB92:
      case 0x5EB92:
      case 0x3EB92:
      i = i + 1;
      case 0xDEB92:
      i = i - 1;
      case 0xD0B92:
    key_value = results.value;
  if (s>6)
  if (s<0)
  if (i>4)
  if (i<0)
  if (i=2) {
    if (s>=3) {
      d = 00000101;
    else {
      d = 00001010;
    left = speed[s];
    right = speed[s];
  if (i != 2) {
    if (i>2) {
      left = turn[i];
      right = 120;
    else {
      right = turn[i];
      left = 120;


  /*digitalWrite(drivepin1, bitRead(d,0));
  digitalWrite(drivepin2, bitRead(d,1));
  analogWrite(enablepinA, right);
  digitalWrite(drivepin3, bitRead(d,2));
  digitalWrite(drivepin4, bitRead(d,3));
  analogWrite(enablepinB, left);    */

That my understanding.
It's completely wrong. The bootloader does not have anything to do with running the sketch after it is loaded. The sketch does NOT have to have a loop() function. One can define a main() function, to stop the IDE adding a main() function. The user-defined main() does not have to call setup() or loop() so neither of those functions would then be needed.
Bar Sport / Re: ARDUINO + Ship automation
Last post by TomGeorge - Today at 01:06 am
There was a very reassuring story about one Airbus pilot saying to the other "what's it doing now?"

Ha ha ha.
I watch the occasional air disaster doco, can someone tell me the answer to this?
If you can fly in an airliner, they can give you a personal video screen and some airlines actually give you a feed to a camera mounted somewhere on the aircraft to watch takeoff and landing.
BUT they cannot supply the cockpit with a a couple of video feeds of the engines?
Every program I have seen, even with the latest flyby wire aircraft, the crew only have what there instruments tell them, so have to send a crew member back into the passenger cabin to look out the window to see if the engine is still there when they suspect a problem! ! ! !
The aircraft design does not allow the crew to look out the cockpit window to see the engines.
From; Madagascar, Escape2 Africa
[Bulb on the fuel guage is flashing]
Kowalski: Skipper, look.
Skipper: Analysis
Kowalski: It looks like a small incandescent bulb, designed to indicate something out of the ordinary, like a malfunction.
Skipper: I find it pretty and somewhat hypnotic.
Kowalski: That too, sir.
Skipper: Right. Rico, maunal!
[Catches the manual and smashes the bulb with it]
Skipper: Problemo solved.
Kowalski: Sir, we may be out of fuel.
Skipper: What makes you think that?
Kowalski: We've lost engine one, and engine two is no longer on fire.
Skipper: Buckle up, boys. Don't look, doll, this might get hairy.
[on the microphone]
Skipper: This is your captain speaking. I have good news and bad news. The good news is that we will be landing immediately.
[everyone claps]
Skipper: The bad news is, we're crash landing.
[Plane goes on a dive]
Skipper: When it comes to air travel, we know that you have no choice whatsoever, but thanks again for choosing Air Penguin.
I love the penguins..
Tom.... :) :)
Hardware / Re: Aiuto!! Funzionamento moto...
Last post by cicciozuc - Today at 01:04 am
Ma il potenziometro devo collegarlo al +5v e gnd di Arduino?
Sensors / Re: ProSense PTD25-20-0200H pr...
Last post by outsider - Today at 01:03 am
Makes sense, TNX & K++.
Pages: [1] 2 3 ... 10