Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 3

im new to all this and could use some help

Solved! Go to Solution.

im currently using terminal on macbook, so while trying to change directories so i could test some code ive written i accidently added a " ' " directly behind the file name i wanted to make the current directory and now terminal is behaving almost like a text editor ignoring every command and putting a ">" in front of everything i type. wth do i do please help

2 Replies
Solution
Copilot Lvl 3
Message 2 of 3

Re: im new to all this and could use some help

You started a quotation, but did not end it, so your shell is expecting you to continue typing your command until you do. When this happens and I do not intend to complete the command because the quote was a mistake, I simply use Ctrl-C to abort the session so it drops back to the prompt without executing anything.

Copilot Lvl 2
Message 3 of 3

Re: im new to all this and could use some help

i wrote some codes for my nrf24lo1 but need some one with a little more experience to look at it and tell me my problem 

 

 

/*
* Arduino Wireless Communication ,stepper,easydriver, pot,nrf24lo1
*  - Receiver Code
*
* by Jason Bickford
*
* Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include "AccelStepper.h"
// AccelStepper Setup
AccelStepper stepper(1, 2, 3); // 1 = Easy Driver interface
// Nano Pin 2 connected to STEP pin of Easy Driver
// Nano Pin 3 connected to DIR pin of Easy Driver
RF24 radio(7, 8); // CE, CSN
const byte addresses[][6] = {"00001", "00002"};

// Variables to store current, previous and move position
int val = 0;
int previous = 0;
int long newval = 0;

void setup() {

radio.begin();
radio.openWritingPipe(addresses[0]); // 00002
radio.openReadingPipe(1, addresses[1]); // 00001
radio.setPALevel(RF24_PA_MIN);
stepper.setMaxSpeed(4800); // Set speed fast enough to follow pot rotation
stepper.setAcceleration(4800); // High Acceleration to follow pot rotation

}
void loop() {
delay(5);
radio.startListening();
if ( radio.available()) {
while (radio.available()) {
int potvalue = 0;
radio.read(&val,sizeof(potvalue));
Read Potentiometer current value
if ((val > previous+6) || (val < previous-6)) { // Check that a move of the pot is at least > or < than 6
newval = map(val, 0, 1023, 0, 800); // Map value (1600 = 1 stepper shaft rotation)
stepper.runToNewPosition(newval); // Move stepper to new position
previous = val; // save current value into variable previous
AccelStepper .write(newval,sizeof (newval));
}
delay(5);
radio.stopListening();

radio.write(&buttonState, sizeof(buttonState));
}
}

 

Arduino Wireless Communication Tutorial
*  - Transmitter Code, Stepper Control with Potentiometer
*
* by Jason Bickford
*
* Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include "AccelStepper.h"

RF24 radio(7, 8); // CE, CSN
const byte addresses[][6] = {"00001", "00002"};
// Variables to store current, previous and move position
int val = 0;
int previous = 0;
int long newval = 0;
void setup() {

radio.begin();
radio.openWritingPipe(addresses[1]); // 00001
radio.openReadingPipe(1, addresses[0]); // 00002
radio.setPALevel(RF24_PA_MIN);
}
void loop() {
delay(5);
radio.stopListening();
int potValue = analogRead(A0); // Read Potentiometer current value

radio.write(&val, sizeof (val));
delay(5);
radio.startListening();
while (!radio.available());{


}
}