Jump to content

maxik

Members
  • Content Count

    18
  • Joined

  • Last visited

About maxik

  • Rank
    Member
  • Birthday 05/01/1993

Contact Methods

  • Website URL
    http://maxik.me

Profile Information

  • Gender
    Male
  • Location
    Gdansk, Poland
  1. It works! Hangs after few minutes, but I doubt it's caused by the library. Thank you, spirilis!
  2. Unfortunately it won't : error: invalid conversion from 'void*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive] E:\ener10\hardware\msp430\cores\msp430/Print.h:57:20: error: initializing argument 1 of 'virtual size_t Print::write(const uint8_t*, size_t)' [-fpermissive]
  3. Malloc was my last try anyway. Here is the code: #include <Enrf24.h> #include <nRF24L01.h> #include <SPI.h> typedef struct { byte red; byte green; byte blue; } color_t; Enrf24 radio(P2_0, P2_1, P2_2); const uint8_t txaddr[] = { 0x01, 0x02, 0x03, 0x04, 0x05 }; color_t data; void setup() { SPI.begin(); SPI.setDataMode(SPI_MODE0); SPI.setBitOrder(1); radio.begin(); radio.setTXaddress((void*)txaddr); randomSeed(analogRead(1)); //A1 pinMode(RED_LED, OUTPUT); pinMode(GREEN_LED, OUTPUT); if(radio.radioState() != ENRF24_STATE_NOTPRESENT) { digitalWrite(GREEN_LED, HIGH); } else { analogWrite(GREEN_LED, 60); } } void loop() { digitalWrite(RED_LED, HIGH); data.red = random(0, 256); data.green = random(0, 256); data.blue = random(0, 256); radio.write((void*)data, sizeof(color_t)); radio.flush(); delay(20); digitalWrite(RED_LED, LOW); delay(2000); } I changed C++ like struct define to C like typedef. sizeof(struct color_t) will generate another error as compiler is trying to declare color_t again.
  4. Thank you for the replies. #include <Enrf24.h> #include <nRF24L01.h> #include <SPI.h> struct color_t { byte red; byte green; byte blue; }; Enrf24 radio(P2_0, P2_1, P2_2); const uint8_t txaddr[] = { 0x01, 0x02, 0x03, 0x04, 0x05 }; color_t *data = (color_t *)malloc(sizeof(color_t)); void setup() { SPI.begin(); SPI.setDataMode(SPI_MODE0); SPI.setBitOrder(1); radio.begin(); radio.setTXaddress((void*)txaddr); randomSeed(analogRead(1)); //A1 pinMode(RED_LED, OUTPUT); pinMode(GREEN_LED, OUTPUT); if(radio.radioState() != ENRF24_STATE_NOTPRESENT) { digitalWrite(GREEN_LED, HIGH); } else { analogWrite(GREEN_LED, 60); } } void loop() { digitalWrite(RED_LED, HIGH); data->red = random(0, 256); data->green = random(0, 256); data->blue = random(0, 256); radio.write(data, sizeof(data)); radio.flush(); delay(20); digitalWrite(RED_LED, LOW); delay(2000); } This is the code I wrote. I tried: Pointer returned by malloc, as you can see above Casting the struct to (void *) *data and &data Everything that came to my mind All of the above using .write() method. None worked for me. The sketch won't even compile as there is "no matching function" or "invalid cast from type 'color_t' to type 'void*'". I ran out of ideas so any help will be appreciated.
  5. I still haven't figured out a way to send a struct using this library. Neither write nor print will accept pointer to struct. I know that the RF24 library can do such thing, but it doesn't work with Energia and MSP430. Sorry for asking for it again, but it is a blocker for my project. Any chance you could implement this functionality in some future version or maybe just point me how to do that?
  6. Hey, Thank you for the library, it looks much better and seems much easier to use than the Mirf available for the Arduino. So far I've only tried demo sketches on two MSP430 LaunchPads. I would like to make remote control using two StellarPads or a LaunchPad and a StellarPad, I thought about sending structs over the nRFs. Will I be able to do that? I mean, send struct and receive it on the other end. Should I use print method or some other one?
  7. maxik

    New Energia release 0101E0009 - 12/06/2012

    Thank you for the Stellaris support, but when I try to upload "Blink" I keep getting "Cannot run program "E:\ENERGI~1\HARDWARE\TOOLS\LM4F\BIN\arm-none-eabi-g++" CreateProcess error=2 File not found". EDIT: Fixed this by renaming energia's folder from "energia-0101E0009" or so to "ener9", name seems to be an issue. Fix this please or note somewhere that folder name can't be longer than 6 characters.
  8. maxik

    Stellaris Launchpad shipping details

    Yesterday, I've received two MSP430 Launchpads 10 days before the estimate(4 days from USA to Poland, pretty impressive), so I'm optimistic about Stellaris delivery
  9. maxik

    New User problem

    Wiki is probably out of date, tone() works as expected, I've just tested it with buzzer to be sure. void setup() { pinMode(P1_5, OUTPUT); } void loop(){ tone(P1_5, 2193, 150); delay(250); }
  10. I've ordered one more for $4.99 yesterday when I saw this topic and it turned up to be a good decision: http://i50.tinypic.com/muz7l4.png Stellaris LaunchPad just lost one of its most significant advantages.
  11. maxik

    Stellaris Launchpad shipping details

    MSP430 LaunchPad was quicker by about five days for me I hope we will hear some word of clarification from TI. If not I won't hesitate to ask them by email, they have great customer support
  12. maxik

    Stellaris Launchpad shipping details

    Est. ship: 11/09/2012 Ordered on 8/31/2012 2:54:31 PM It is not nice, TI said: "Order your kit now through the TI eStore and your Stellaris LaunchPad will be ready to ship when we start accepting regular orders on September 25!". I don't think they need more than a month to get it from "ready" to "delivered".
  13. I've got the same display from eBay and it works well with Energia on Windows.
  14. maxik

    energia device support

    Support for Stellaris LaunchPad would be great as well, but I think it will require a lot of work as it is completely different MCU architecture. The bright side is somebody made that already, LeafLabs Maple is based on ARM and has Arduino-like IDE, so it is feasible. Also, Arduino family is waiting for release of ARM-based Due and maybe it will make porting easier.
  15. maxik

    TWI/I2C on Energia 0101E0008

    I just tried this code on clean installation of Energia and it compiles! It think that 0006 version and 0008 version got mixed up and that's why it didn't work. Sorry for your trouble and thank you for your willingness to help, I really appreciate it. Keep up the good work Energia team.
×