Show Posts
|
|
Pages: [1] 2 3
|
|
2
|
Using Arduino / Programming Questions / Re: nrf24l01
|
on: February 28, 2013, 09:41:23 pm
|
That code isn't doing anything that warrants moving to a Mega. So, why are you?
that code isn't doing anything but my other codes might need it, I want to get the nrf to work on a mega first thenI can do the rest. this is just code I copied to get it to communicate to a raspberry pi. its good but I wantto upgrade to a mega for other things
|
|
|
|
|
3
|
Using Arduino / Displays / Re: Sainsmart 3.2 tft shield wont respond
|
on: February 23, 2013, 04:12:40 am
|
most places I see use a different library. I found the UTFT library worked well with the sainsmart screen and I had a program that printed hello world but if you want a quick easy copy paste job #include <UTFT.h>
// Declare which fonts we will be using extern uint8_t BigFont[]; extern uint8_t SevenSegNumFont[];
// Uncomment the next line for Arduino 2009/Uno //UTFT myGLCD(ITDB32S,19,18,17,16); // Remember to change the model parameter to suit your display module!
// Uncomment the next line for Arduino Mega UTFT myGLCD(ITDB32S,38,39,40,41); // Remember to change the model parameter to suit your display module!
void setup() { myGLCD.InitLCD(); myGLCD.clrScr(); myGLCD.setFont(BigFont); }
void loop() { myGLCD.print("Text rotation", 0, 0); myGLCD.setColor(0, 0, 255); myGLCD.print("0 degrees", 0, 16, 0); myGLCD.print("90 degrees", 319, 0, 90); myGLCD.print("180 degrees", 319, 239, 180); myGLCD.print("270 degrees", 0, 239, 270);
myGLCD.setFont(SevenSegNumFont); myGLCD.setColor(0, 255, 0); myGLCD.print("45", 90, 100, 45); myGLCD.print("90", 200, 50, 90); myGLCD.print("180", 300, 200, 180);
while (true) {}; }
Report to moderator Logged
install the utft library from http://henningkarlsen.com/electronics/library.php?id=52 first though
|
|
|
|
|
5
|
Using Arduino / Programming Questions / Re: nrf24l01
|
on: February 23, 2013, 03:57:43 am
|
/* Copyright (C) 2011 J. Coliz <maniacbug@ymail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. */
/** * This example will receive dynamic payload from the Raspberry Pi and send * back the payload to the Raspberry Pi * I have added the LCD Module to display the payload and payload length * on a 20x4 LCD Module * * Stanley Seow * stanleyseow@gmail.com */ #include <LiquidCrystal.h> #include <SPI.h> #include "nRF24L01.h" #include "RF24.h" #include "printf.h"
LiquidCrystal lcd(10, 9, 3, 4, 5, 6); // Make way for the SPI pins // 10 -> LCD 4 // 9 -> LCD 6 // 3 -> LCD 11 // 4 -> LCD 12 // 5 -> LCD 13 // 6 -> LCD 14
// // Hardware configuration //
// Set up nRF24L01 radio on SPI bus plus pins 3 & 4
RF24 radio(8,7); // // Topology //
// Radio pipe addresses for the 2 nodes to communicate. const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };
// // Payload //
const int min_payload_size = 4; const int max_payload_size = 32; const int payload_size_increments_by = 2; int next_payload_size = min_payload_size;
char receive_payload[max_payload_size+1]; // +1 to allow room for a terminating NULL char
void setup(void) { // Setup LCD lcd.begin(20,4); // col,row lcd.setCursor(0,0); lcd.print("nRF24L01 to RPi"); pinMode(2, OUTPUT); // Print preamble //
Serial.begin(57600); printf_begin(); printf("\n\rRF24/examples/pingpair_dyn/\n\r"); // // Setup and configure rf radio //
radio.begin();
// enable dynamic payloads radio.enableDynamicPayloads();
// optionally, increase the delay between retries & # of retries radio.setRetries(15,15); radio.setDataRate(RF24_1MBPS); // // Open pipes to other nodes for communication //
// This simple sketch opens two pipes for these two nodes to communicate // back and forth. // Open 'our' pipe for writing // Open the 'other' pipe for reading, in position #1 (we can have up to 5 pipes open for reading)
radio.openWritingPipe(pipes[1]); radio.openReadingPipe(1,pipes[0]); // // Start listening //
radio.startListening();
// // Dump the configuration of the rf unit for debugging //
radio.printDetails(); }
void loop(void) {
// if there is data ready if ( radio.available() ) { // Dump the payloads until we've gotten everything uint8_t len; bool done = false; while (!done) { // Fetch the payload, and see if this was the last one. len = radio.getDynamicPayloadSize(); done = radio.read( receive_payload, len );
// Put a zero at the end for easy printing receive_payload[len] = 0;
// Spew it printf("Got payload size=%i value=%s\n\r",len,receive_payload); lcd.clear(); lcd.setCursor(0,0); lcd.print(len); lcd.setCursor(0,1); lcd.print(receive_payload); digitalWrite(2,HIGH); // Turn on Beep }
// First, stop listening so we can talk radio.stopListening(); delay(50); // Put a small delay before sending response back // Send the final one back. radio.write( receive_payload, len ); printf("Sent response.\n\r");
// Now, resume listening so we catch the next packets. radio.startListening(); delay(50); // Have a small delay digitalWrite(2,LOW); // Turn off beep
}
}
|
|
|
|
|
9
|
Using Arduino / Programming Questions / Joystick Mouse Control issue
|
on: February 19, 2013, 10:35:18 pm
|
http://arduino.cc/en/Tutorial/JoystickMouseControlthats the tutorial but when I compile the program I get errors sketch_feb20a.ino: In function 'void setup()': sketch_feb20a:51: error: 'Mouse' was not declared in this scope sketch_feb20a.ino: In function 'void loop()': sketch_feb20a:74: error: 'Mouse' was not declared in this scope sketch_feb20a:81: error: 'Mouse' was not declared in this scope sketch_feb20a:81: error: 'MOUSE_LEFT' was not declared in this scope sketch_feb20a:88: error: 'Mouse' was not declared in this scope sketch_feb20a:88: error: 'MOUSE_LEFT' was not declared in this scope so what am I missing? is there a library I can't see? or is there something missing in the code?
|
|
|
|
|
10
|
Community / Local Groups / brisbane AU
|
on: February 16, 2013, 02:07:03 am
|
|
HEy all, I am looking for people in the brisbane area interested in arduino. I am looking for someone to help with programming more than anything but am very willing to talk to people just interested in arduino too. I can be reached on google talk most friday saturdays. I am hoping to find people in helping in home automation, and programming mini games for items like the sainsmart 3.2 lcd with touch and SD card. if anyone is interested please post here and let me know what areas you are interested in phil
|
|
|
|
|
11
|
Using Arduino / Programming Questions / Re: libraries
|
on: February 09, 2013, 05:20:05 am
|
|
so my thoughts were correct.the standards are not there. I was thinking of having a generic library for minimal function on, for example, displays, one library that all screens will use to do a simple heelo world sketch. then have the extras come later with more specific libraries. I am after a repositry for basic use. I am still learning programming and having a standard basis for all items. this way I can download all the basic functions for sensors etc and then expand as I need them. so this basic thing I have learnt is even though 2 items are very similiar the libraries are very different making it impossible to have a repositry for all libraries
|
|
|
|
|
12
|
Using Arduino / Programming Questions / Re: libraries
|
on: February 08, 2013, 09:09:36 pm
|
|
shield list I have not heard of. i will look into it. I do believe the big issue is that there are so many shields. take for example screens. Is there a standard they have to meet? alot of times I see things hooked up to different pins, screensare a perfect example, but you could change that in your main program, but is the rest of the shield standard so 1 library can run multiple brands, sizes, resolutions? getting so many different libraries and finding out 2 or 3are almost identical (some may have different library names thats all) is always fun and everyone wants you to download THEIR library and no one elses. If a repository was to work then a standard would also have to be implemented or is there a way around that?
|
|
|
|
|
13
|
Using Arduino / Programming Questions / Re: libraries
|
on: February 08, 2013, 09:57:32 am
|
http://arduino.cc/en/Reference/Librariesthis is an example of what I am talking about. got a great start list but you have to go into every link to download each file, how about just putting it in a zip file at the bottom that would save alot of time. there are other sites, there is a tft shield I have it has tft, touchscreen, and USB.... but I have to find 3 libraries for this device instead of 1 zip. there are a multitude of devices and we have to download more and more libraries I am just asking if it is possible to start a repositry of some sort where we can "tick" the ones we want and get them in a download file to make life so much easier
|
|
|
|
|
14
|
Using Arduino / Programming Questions / libraries
|
on: February 08, 2013, 01:02:17 am
|
|
Hey guys I hope I am not asking too much here, but where can I find ALL libraries for this site in one simple zip file or something? I want to play with arduino while on holidays and cannot guarantee an internet connection so I would like all the libraries in advance but going through each link (and there are quite a number) I found I was downloading 100+ libraries that are really only 1 meg each.. so does anyone know where to find them all in 1 zip file ready to download?
|
|
|
|
|
15
|
Using Arduino / Displays / Re: 3.2 Sainsmart TFT touch issues
|
on: February 04, 2013, 07:23:54 am
|
|
I used the codes supplied to check my screens and they work to a point. the second coding inverts my vertical touch however. how do I change that? do I change the pins around in the code?
|
|
|
|
|